EReference eReference = (EReference)theEObject; T result = caseEReference(eReference); if (result == null) result = caseEStructuralFeature(eReference); if (result == null) result = caseETypedElement(eReference); if (result == null) result = caseENamedElement(eReference); if (result == null) result = caseEModelElement(eReference); if (result == null) result = defaultCase(theEObject); return result;
EAttribute eAttribute = (EAttribute)theEObject; T result = caseEAttribute(eAttribute); if (result == null) result = caseEStructuralFeature(eAttribute); if (result == null) result = caseETypedElement(eAttribute); if (result == null) result = caseENamedElement(eAttribute); if (result == null) result = caseEModelElement(eAttribute); 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: 13 Number of AST nodes: 13
1
EReference eReference = (EReference)theEObject;
1
EAttribute eAttribute = (EAttribute)theEObject;
2
        T result = caseEReference(eReference);
2
        T result = caseEAttribute(eAttribute);
3
        if (result == null) result = caseEStructuralFeature(eReference);
3
        if (result == null) result = caseEStructuralFeature(eAttribute);
4
        if (result == null) result = caseETypedElement(eReference);
4
        if (result == null) result = caseETypedElement(eAttribute);
5
        if (result == null) result = caseENamedElement(eReference);
5
        if (result == null) result = caseENamedElement(eAttribute);
6
        if (result == null) result = caseEModelElement(eReference);
6
        if (result == null) result = caseEModelElement(eAttribute);
7
        if (result == null) result = defaultCase(theEObject);
7
        if (result == null) result = defaultCase(theEObject);
8
        return result;
8
        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.9
Clones locationClones are in the same method
Number of node comparisons80
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                    
    3
    EAttribute eAttribute = (EAttribute)theEObject;
                                                                                  
    4
    T result = caseEAttribute(eAttribute);
    139
    EReference eReference = (EReference)theEObject;
                                                                                                        
    140
    T result = caseEReference(eReference);
                                                                                      
    141
    if (result == null)
    5
    if (result == null)
    142
    result = caseEStructuralFeature(eReference);
    142
    result = caseEStructuralFeature(eReference);
    6
    result = caseEStructuralFeature(eAttribute);
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    6
    result = caseEStructuralFeature(eAttribute);
    143
    if (result == null)
    7
    if (result == null)
    144
    result = caseETypedElement(eReference);
    144
    result = caseETypedElement(eReference);
    8
    result = caseETypedElement(eAttribute);
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    8
    result = caseETypedElement(eAttribute);
    145
    if (result == null)
    9
    if (result == null)
    146
    result = caseENamedElement(eReference);
    146
    result = caseENamedElement(eReference);
    10
    result = caseENamedElement(eAttribute);
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    10
    result = caseENamedElement(eAttribute);
    147
    if (result == null)
    11
    if (result == null)
    148
    result = caseEModelElement(eReference);
    148
    result = caseEModelElement(eReference);
    12
    result = caseEModelElement(eAttribute);
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    12
    result = caseEModelElement(eAttribute);
    149
    if (result == null)
    13
    if (result == null)
    150
    result = defaultCase(theEObject);
    14
    result = defaultCase(theEObject);
    151
    return result;
    15
    return result;
    Precondition Violations (4)
    Row Violation
    1Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    2Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    3Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    4Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute