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;
Ecore2EcoreMappingRoot ecore2EcoreMappingRoot = (Ecore2EcoreMappingRoot)theEObject; T result = caseEcore2EcoreMappingRoot(ecore2EcoreMappingRoot); if (result == null) result = caseMappingRoot(ecore2EcoreMappingRoot); if (result == null) result = caseMapping(ecore2EcoreMappingRoot); 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/mapping/ecore2ecore/util/Ecore2EcoreSwitch.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
E
2
        T result = caseEPackage(ePackage
2
core2EcoreMappingRoot ecore2EcoreMappingRoot = (Ecore2EcoreMappingRoot)theEObject;
3
);
3
        T result = caseEcore2EcoreMappingRoot(ecore2EcoreMappingRoot);
4
        if (result == null) result = caseENamedElement(ePackage);
4
        if (result == null) result = caseMappingRoot(ecore2EcoreMappingRoot);
5
        if (result == null) result = caseEModelElement(ePackage);
5
        if (result == null) result = caseMapping(ecore2EcoreMappingRoot);
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.4
Clones locationClones are in different classes
Number of node comparisons37
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                            
    3
    Ecore2EcoreMappingRoot ecore2EcoreMappingRoot = (Ecore2EcoreMappingRoot)theEObject;
                                                                                                                                  
    4
    T result = caseEcore2EcoreMappingRoot(ecore2EcoreMappingRoot);
    117
    EPackage ePackage = (EPackage)theEObject;
                                                                                            
    118
    T result = caseEPackage(ePackage);
                                                                              
    119
    if (result == null)
    119
    if (result == null)
    9
    if (result == null)
    Differences
    Expression1Expression2Difference
    TTVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type T of variable result does not match with type T of variable result
    • Make classes T and T extend a common superclass
    9
    if (result == null)
                                                                          
    10
    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
    10
    result = defaultCase(theEObject);
    120
    result = caseENamedElement(ePackage);
    120
    result = caseENamedElement(ePackage);
    Preondition Violations
    Unmatched statement result=caseENamedElement(ePackage); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    121
    if (result == null)
    121
    if (result == null)
    7
    if (result == null)
    Differences
    Expression1Expression2Difference
    TTVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type T of variable result does not match with type T of variable result
    • Make classes T and T extend a common superclass
    7
    if (result == null)
                                                                                                
    8
    result = caseMapping(ecore2EcoreMappingRoot);
    Preondition Violations
    Unmatched statement result=caseMapping(ecore2EcoreMappingRoot); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    result = caseMapping(ecore2EcoreMappingRoot);
    122
    result = caseEModelElement(ePackage);
    122
    result = caseEModelElement(ePackage);
    Preondition Violations
    Unmatched statement result=caseEModelElement(ePackage); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    123
    if (result == null)
    123
    if (result == null)
    5
    if (result == null)
    Differences
    Expression1Expression2Difference
    TTVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type T of variable result does not match with type T of variable result
    • Make classes T and T extend a common superclass
    5
    if (result == null)
                                                                                                        
    6
    result = caseMappingRoot(ecore2EcoreMappingRoot);
    Preondition Violations
    Unmatched statement result=caseMappingRoot(ecore2EcoreMappingRoot); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    result = caseMappingRoot(ecore2EcoreMappingRoot);
    124
    result = defaultCase(theEObject);
    124
    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
                                                                            
                                        
    11
    return result;
    Preondition Violations
    Unmatched return result;
    11
    return result;
    125
    return result;
    125
    return result;
    Preondition Violations
    Unmatched return result;
                                          
    Precondition Violations (11)
    Row Violation
    1Type T of variable result does not match with type T of variable result
    2Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=caseENamedElement(ePackage); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Type T of variable result does not match with type T of variable result
    5Unmatched statement result=caseMapping(ecore2EcoreMappingRoot); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement result=caseEModelElement(ePackage); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Type T of variable result does not match with type T of variable result
    8Unmatched statement result=caseMappingRoot(ecore2EcoreMappingRoot); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched return result;
    11Unmatched return result;