FunctionPair functionPair = (FunctionPair)theEObject; T result = caseFunctionPair(functionPair); if (result == null) result = caseTypeConverter(functionPair); if (result == null) result = caseMappingHelper(functionPair); if (result == null) result = defaultCase(theEObject); return result;
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;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/util/MappingSwitch.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
FunctionPair functionPair = (FunctionPair)theEObject;
1
EPackage ePackage = (EPackage)theEObject;
2
        T result = caseFunctionPair(functionPair);
2
        T result = caseEPackage(ePackage);
3
        if (result == null) result = caseTypeConverter(functionPair);
3
        if (result == null) result = caseENamedElement(ePackage);
4
        if (result == null) result = caseMappingHelper(functionPair);
4
        if (result == null) result = caseEModelElement(ePackage);
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 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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    FunctionPair functionPair = (FunctionPair)theEObject;
                                                                                                                  
    24
    T result = caseFunctionPair(functionPair);
                                                                                            
                                                                                            
    117
    EPackage ePackage = (EPackage)theEObject;
                                                                              
    118
    T result = caseEPackage(ePackage);
    25
    if (result == null)
    25
    if (result == null)
    119
    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
    119
    if (result == null)
    26
    result = caseTypeConverter(functionPair);
    26
    result = caseTypeConverter(functionPair);
    Preondition Violations
    Unmatched statement result=caseTypeConverter(functionPair); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                                                                    
    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
    120
    result = caseENamedElement(ePackage);
    27
    if (result == null)
    27
    if (result == null)
    121
    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
    121
    if (result == null)
    28
    result = caseMappingHelper(functionPair);
    28
    result = caseMappingHelper(functionPair);
    Preondition Violations
    Unmatched statement result=caseMappingHelper(functionPair); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                                                                    
    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
    122
    result = caseEModelElement(ePackage);
    29
    if (result == null)
    29
    if (result == null)
    123
    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
    123
    if (result == null)
    30
    result = defaultCase(theEObject);
    30
    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
                                                                          
                                                                            
    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
    124
    result = defaultCase(theEObject);
    31
    return result;
    31
    return result;
    Preondition Violations
    Unmatched return result;
                                        
                                          
    125
    return result;
    Preondition Violations
    Unmatched return result;
    125
    return result;
    Precondition Violations (11)
    Row Violation
    1Type T of variable result does not match with type T of variable result
    2Unmatched statement result=caseTypeConverter(functionPair); 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=caseMappingHelper(functionPair); 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=defaultCase(theEObject); 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;