EPackage ePackage = (EPackage)theEObject; T result = caseEPackage(ePackage); if (result == null) result = caseENamedElement(ePackage); if (result == null) result = caseEModelElement(ePackage); if (result == null) result = defaultCase(theEObject); return result;
EEnumLiteral eEnumLiteral = (EEnumLiteral)theEObject; T result = caseEEnumLiteral(eEnumLiteral); if (result == null) result = caseENamedElement(eEnumLiteral); if (result == null) result = caseEModelElement(eEnumLiteral); 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: 9 Number of AST nodes: 9
1
EPackage ePackage = (EPackage)theEObject;
1
EEnumLiteral eEnumLiteral = (EEnumLiteral)theEObject;
2
        T result = caseEPackage(ePackage);
2
        T result = caseEEnumLiteral(eEnumLiteral);
3
        if (result == null) result = caseENamedElement(ePackage);
3
        if (result == null) result = caseENamedElement(eEnumLiteral);
4
        if (result == null) result = caseEModelElement(ePackage);
4
        if (result == null) result = caseEModelElement(eEnumLiteral);
5
        if (result == null) result = defaultCase(theEObject);
5
        if (result == null) result = defaultCase(theEObject);
6
        return result;
6
        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.4
Clones locationClones are in the same method
Number of node comparisons37
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                  
    73
    EEnumLiteral eEnumLiteral = (EEnumLiteral)theEObject;
                                                                                            
    74
    T result = caseEEnumLiteral(eEnumLiteral);
    117
    EPackage ePackage = (EPackage)theEObject;
                                                                                            
    118
    T result = caseEPackage(ePackage);
                                                                              
    119
    if (result == null)
    75
    if (result == null)
    120
    result = caseENamedElement(ePackage);
    120
    result = caseENamedElement(ePackage);
    76
    result = caseENamedElement(eEnumLiteral);
    Differences
    Expression1Expression2Difference
    ePackageeEnumLiteralVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EPackageorg.eclipse.emf.ecore.EEnumLiteralVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EPackage of variable ePackage does not match with type org.eclipse.emf.ecore.EEnumLiteral of variable eEnumLiteral
    • Make classes org.eclipse.emf.ecore.EPackage and org.eclipse.emf.ecore.EEnumLiteral extend a common superclass
    76
    result = caseENamedElement(eEnumLiteral);
    121
    if (result == null)
    77
    if (result == null)
    122
    result = caseEModelElement(ePackage);
    122
    result = caseEModelElement(ePackage);
    78
    result = caseEModelElement(eEnumLiteral);
    Differences
    Expression1Expression2Difference
    ePackageeEnumLiteralVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EPackageorg.eclipse.emf.ecore.EEnumLiteralVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EPackage of variable ePackage does not match with type org.eclipse.emf.ecore.EEnumLiteral of variable eEnumLiteral
    • Make classes org.eclipse.emf.ecore.EPackage and org.eclipse.emf.ecore.EEnumLiteral extend a common superclass
    78
    result = caseEModelElement(eEnumLiteral);
    123
    if (result == null)
    79
    if (result == null)
    124
    result = defaultCase(theEObject);
    80
    result = defaultCase(theEObject);
    125
    return result;
    81
    return result;
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EPackage of variable ePackage does not match with type org.eclipse.emf.ecore.EEnumLiteral of variable eEnumLiteral
    2Type org.eclipse.emf.ecore.EPackage of variable ePackage does not match with type org.eclipse.emf.ecore.EEnumLiteral of variable eEnumLiteral