EStructuralFeature eStructuralFeature = (EStructuralFeature)theEObject; T result = caseEStructuralFeature(eStructuralFeature); if (result == null) result = caseETypedElement(eStructuralFeature); if (result == null) result = caseENamedElement(eStructuralFeature); if (result == null) result = caseEModelElement(eStructuralFeature); if (result == null) result = defaultCase(theEObject); return result;
EClass eClass = (EClass)theEObject; T result = caseEClass(eClass); if (result == null) result = caseEClassifier(eClass); if (result == null) result = caseENamedElement(eClass); if (result == null) result = caseEModelElement(eClass); if (result == null) result = defaultCase(theEObject); return result;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreSwitch.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreSwitch.java
Method name: T doSwitch(int, EObject) Method name: T doSwitch(int, EObject)
Number of AST nodes: 11 Number of AST nodes: 11
1
EStructuralFeature eStructuralFeature = (EStructuralFeature)theEObject;
1
EClass eClass = (EClass)theEObject;
2
        T result = caseEStructuralFeature(eStructuralFeature);
2
        T result = caseEClass(eClass);
3
        if (result == null) result = caseETypedElement(eStructuralFeature);
3
        if (result == null) result = caseEClassifier(eClass);
4
        if (result == null) result = caseENamedElement(eStructuralFeature);
4
        if (result == null) result = caseENamedElement(eClass);
5
        if (result == null) result = caseEModelElement(eStructuralFeature);
5
        if (result == null) result = caseEModelElement(eClass);
6
        if (result == null) result = defaultCase(theEObject);
6
        if (result == null) result = defaultCase(theEObject);
7
        return result;
7
        return result;
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.6
Clones locationClones are in the same method
Number of node comparisons56
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                              
    25
    EClass eClass = (EClass)theEObject;
                                                                    
    26
    T result = caseEClass(eClass);
    153
    EStructuralFeature eStructuralFeature = (EStructuralFeature)theEObject;
                                                                                                                                                        
    154
    T result = caseEStructuralFeature(eStructuralFeature);
                                                                                                                      
    155
    if (result == null)
    33
    if (result == null)
                                                                          
    34
    result = defaultCase(theEObject);
    Preondition Violations
    Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34
    result = defaultCase(theEObject);
    156
    result = caseETypedElement(eStructuralFeature);
    156
    result = caseETypedElement(eStructuralFeature);
    Preondition Violations
    Unmatched statement result=caseETypedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                        
    157
    if (result == null)
    29
    if (result == null)
    158
    result = caseENamedElement(eStructuralFeature);
    158
    result = caseENamedElement(eStructuralFeature);
    30
    result = caseENamedElement(eClass);
    Differences
    Expression1Expression2Difference
    eStructuralFeatureeClassVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EStructuralFeatureorg.eclipse.emf.ecore.EClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EClass of variable eClass
    • Make classes org.eclipse.emf.ecore.EStructuralFeature and org.eclipse.emf.ecore.EClass extend a common superclass
    30
    result = caseENamedElement(eClass);
    159
    if (result == null)
    31
    if (result == null)
    160
    result = caseEModelElement(eStructuralFeature);
    160
    result = caseEModelElement(eStructuralFeature);
    32
    result = caseEModelElement(eClass);
    Differences
    Expression1Expression2Difference
    eStructuralFeatureeClassVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EStructuralFeatureorg.eclipse.emf.ecore.EClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EClass of variable eClass
    • Make classes org.eclipse.emf.ecore.EStructuralFeature and org.eclipse.emf.ecore.EClass extend a common superclass
    32
    result = caseEModelElement(eClass);
    161
    if (result == null)
    27
    if (result == null)
                                                                          
    28
    result = caseEClassifier(eClass);
    Preondition Violations
    Unmatched statement result=caseEClassifier(eClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28
    result = caseEClassifier(eClass);
    162
    result = defaultCase(theEObject);
    162
    result = defaultCase(theEObject);
    Preondition Violations
    Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
    163
    return result;
    35
    return result;
    Precondition Violations (6)
    Row Violation
    1Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=caseETypedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EClass of variable eClass
    4Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EClass of variable eClass
    5Unmatched statement result=caseEClassifier(eClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted