if (theEClass.eContainer() == modelPackage) { return doSwitch(theEClass.getClassifierID(), theEObject); } else { List<EClass> eSuperTypes = theEClass.getESuperTypes(); return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); }
if (theEClass.eContainer() == modelPackage) { return doSwitch(theEClass.getClassifierID(), theEObject); } else { List<EClass> eSuperTypes = theEClass.getESuperTypes(); return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/util/TreeSwitch.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreSwitch.java
Method name: T doSwitch(EClass, EObject) Method name: T doSwitch(EClass, EObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (theEClass.eContainer() == modelPackage)
1
if (theEClass.eContainer() == modelPackage)
2
    {
2
    {
3
      return doSwitch(theEClass.getClassifierID(), theEObject);
3
      return doSwitch(theEClass.getClassifierID(), theEObject);
4
    }
4
    }
5
    else
5
    else
6
    {
6
    {
7
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
7
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
8
      return
8
      return
9
        eSuperTypes.isEmpty() ?
9
        eSuperTypes.isEmpty() ?
10
          defaultCase(theEObject) :
10
          defaultCase(theEObject) :
11
          doSwitch(eSuperTypes.get(0), theEObject);
11
          doSwitch(eSuperTypes.get(0), theEObject);
12
    }
12
    }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (theEClass.eContainer() == modelPackage)
    1
    if (theEClass.eContainer() == modelPackage)
    1
    if (theEClass.eContainer() == modelPackage)
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.edit.tree.TreePackageorg.eclipse.emf.ecore.EcorePackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.edit.tree.TreePackage of variable modelPackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable modelPackage
    • Make classes org.eclipse.emf.edit.tree.TreePackage and org.eclipse.emf.ecore.EcorePackage extend a common superclass
    1
    if (theEClass.eContainer() == modelPackage)
                                                                                                                          
    2
    return doSwitch(theEClass.getClassifierID(), theEObject);
    Preondition Violations
    Unmatched statement return doSwitch(theEClass.getClassifierID(),theEObject); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return doSwitch(theEClass.getClassifierID(),theEObject);
    2
    return doSwitch(theEClass.getClassifierID(), theEObject);
    2
    return doSwitch(theEClass.getClassifierID(), theEObject);
    2
    return doSwitch(theEClass.getClassifierID(), theEObject);
    Preondition Violations
    Unmatched statement return doSwitch(theEClass.getClassifierID(),theEObject); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return doSwitch(theEClass.getClassifierID(),theEObject);
                                                                                                                          
    else
    else
    3
    List<EClass> eSuperTypes = theEClass.getESuperTypes();
    3
    List<EClass> eSuperTypes = theEClass.getESuperTypes();
                                                                                                                                                                                                            
    4
    return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
    4
    return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
                                                                                                                                                                                                            
    Precondition Violations (5)
    Row Violation
    1Type org.eclipse.emf.edit.tree.TreePackage of variable modelPackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable modelPackage
    2Unmatched statement return doSwitch(theEClass.getClassifierID(),theEObject); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return doSwitch(theEClass.getClassifierID(),theEObject);
    4Unmatched statement return doSwitch(theEClass.getClassifierID(),theEObject); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return doSwitch(theEClass.getClassifierID(),theEObject);