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;
ETypeParameter eTypeParameter = (ETypeParameter)theEObject; T result = caseETypeParameter(eTypeParameter); if (result == null) result = caseENamedElement(eTypeParameter); if (result == null) result = caseEModelElement(eTypeParameter); 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
ETypeParameter eTypeParameter = (ETypeParameter)theEObject;
2
        T result = caseFunctionPair(functionPair);
2
        T result = caseETypeParameter(eTypeParameter);
3
        if (result == null) result = caseTypeConverter(functionPair);
3
        if (result == null) result = caseENamedElement(eTypeParameter);
4
        if (result == null) result = caseMappingHelper(functionPair);
4
        if (result == null) result = caseEModelElement(eTypeParameter);
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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    FunctionPair functionPair = (FunctionPair)theEObject;
                                                                                                                  
    24
    T result = caseFunctionPair(functionPair);
                                                                                            
                                                                                                                                
    187
    ETypeParameter eTypeParameter = (ETypeParameter)theEObject;
                                                                                                      
    188
    T result = caseETypeParameter(eTypeParameter);
    25
    if (result == null)
    25
    if (result == null)
    189
    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
    189
    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
                                                                                          
                                                                                                
    190
    result = caseENamedElement(eTypeParameter);
    Preondition Violations
    Unmatched statement result=caseENamedElement(eTypeParameter); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    190
    result = caseENamedElement(eTypeParameter);
    27
    if (result == null)
    27
    if (result == null)
    191
    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
    191
    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
                                                                                          
                                                                                                
    192
    result = caseEModelElement(eTypeParameter);
    Preondition Violations
    Unmatched statement result=caseEModelElement(eTypeParameter); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    192
    result = caseEModelElement(eTypeParameter);
    29
    if (result == null)
    29
    if (result == null)
    193
    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
    193
    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
                                                                          
                                                                            
    194
    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
    194
    result = defaultCase(theEObject);
    31
    return result;
    31
    return result;
    Preondition Violations
    Unmatched return result;
                                        
                                          
    195
    return result;
    Preondition Violations
    Unmatched return result;
    195
    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(eTypeParameter); 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(eTypeParameter); 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;