EAnnotation eAnnotation = (EAnnotation)theEObject; T result = caseEAnnotation(eAnnotation); if (result == null) result = caseEModelElement(eAnnotation); if (result == null) result = defaultCase(theEObject); return result;
MappingRoot mappingRoot = (MappingRoot)theEObject; T result = caseMappingRoot(mappingRoot); if (result == null) result = caseMapping(mappingRoot); 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/util/MappingSwitch.java
Method name: T doSwitch(int, EObject) Method name: T doSwitch(int, EObject)
Number of AST nodes: 7 Number of AST nodes: 7
1
EAnnotation eAnnotation = (EAnnotation)theEObject;
1
MappingRoot mappingRoot = (MappingRoot)theEObject;
2
        T result = caseEAnnotation(eAnnotation);
2
        T result = caseMappingRoot(mappingRoot);
3
        if (result == null) result = caseEModelElement(eAnnotation);
3
        if (result == null) result = caseMapping(mappingRoot);
4
        if (result == null) result = defaultCase(theEObject);
4
        if (result == null) result = defaultCase(theEObject);
5
        return result;
5
        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.2
Clones locationClones are in different classes
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    EAnnotation eAnnotation = (EAnnotation)theEObject;
                                                                                                            
    18
    T result = caseEAnnotation(eAnnotation);
                                                                                        
                                                                                                            
    51
    MappingRoot mappingRoot = (MappingRoot)theEObject;
                                                                                        
    52
    T result = caseMappingRoot(mappingRoot);
    19
    if (result == null)
    19
    if (result == null)
    53
    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
    53
    if (result == null)
    20
    result = caseEModelElement(eAnnotation);
    20
    result = caseEModelElement(eAnnotation);
    Preondition Violations
    Unmatched statement result=caseEModelElement(eAnnotation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
                                                                            
    54
    result = caseMapping(mappingRoot);
    Preondition Violations
    Unmatched statement result=caseMapping(mappingRoot); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    54
    result = caseMapping(mappingRoot);
    21
    if (result == null)
    21
    if (result == null)
    55
    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
    55
    if (result == null)
    22
    result = defaultCase(theEObject);
    22
    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
                                                                          
                                                                          
    56
    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
    56
    result = defaultCase(theEObject);
    23
    return result;
    23
    return result;
    Preondition Violations
    Unmatched return result;
                                        
                                        
    57
    return result;
    Preondition Violations
    Unmatched return result;
    57
    return result;
    Precondition Violations (8)
    Row Violation
    1Type T of variable result does not match with type T of variable result
    2Unmatched statement result=caseEModelElement(eAnnotation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=caseMapping(mappingRoot); 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=defaultCase(theEObject); 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
    7Unmatched return result;
    8Unmatched return result;