EReference eReference = (EReference)theEObject; T result = caseEReference(eReference); if (result == null) result = caseEStructuralFeature(eReference); if (result == null) result = caseETypedElement(eReference); if (result == null) result = caseENamedElement(eReference); if (result == null) result = caseEModelElement(eReference); if (result == null) result = defaultCase(theEObject); return result;
EOperation eOperation = (EOperation)theEObject; T result = caseEOperation(eOperation); if (result == null) result = caseETypedElement(eOperation); if (result == null) result = caseENamedElement(eOperation); if (result == null) result = caseEModelElement(eOperation); 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: 13 Number of AST nodes: 11
1
EReference eReference = (EReference)theEObject;
1
EOperation eOperation = (EOperation)theEObject;
2
        T result = caseEReference(eReference);
2
        T result = caseE
3
        if (result == null) result = caseEStructuralFeature(eReference);
3
Operation(eOperation);
4
        if (result == null) result = caseETypedElement(eReference);
4
        if (result == null) result = caseETypedElement(eOperation);
5
        if (result == null) result = caseENamedElement(eReference);
5
        if (result == null) result = caseENamedElement(eOperation);
6
        if (result == null) result = caseEModelElement(eReference);
6
        if (result == null) result = caseEModelElement(eOperation);
7
        if (result == null) result = defaultCase(theEObject);
7
        if (result == null) result = defaultCase(theEObject);
8
        return result;
8
        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.7
Clones locationClones are in the same method
Number of node comparisons60
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                        
    105
    EOperation eOperation = (EOperation)theEObject;
                                                                                      
    106
    T result = caseEOperation(eOperation);
    139
    EReference eReference = (EReference)theEObject;
                                                                                                        
    140
    T result = caseEReference(eReference);
                                                                                      
    141
    if (result == null)
    113
    if (result == null)
                                                                            
    114
    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
    114
    result = defaultCase(theEObject);
    142
    result = caseEStructuralFeature(eReference);
    142
    result = caseEStructuralFeature(eReference);
    Preondition Violations
    Unmatched statement result=caseEStructuralFeature(eReference); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                  
    143
    if (result == null)
    107
    if (result == null)
    144
    result = caseETypedElement(eReference);
    144
    result = caseETypedElement(eReference);
    108
    result = caseETypedElement(eOperation);
    Differences
    Expression1Expression2Difference
    eReferenceeOperationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EOperationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EOperation extend a common superclass
    108
    result = caseETypedElement(eOperation);
    145
    if (result == null)
    109
    if (result == null)
    146
    result = caseENamedElement(eReference);
    146
    result = caseENamedElement(eReference);
    110
    result = caseENamedElement(eOperation);
    Differences
    Expression1Expression2Difference
    eReferenceeOperationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EOperationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EOperation extend a common superclass
    110
    result = caseENamedElement(eOperation);
    147
    if (result == null)
    111
    if (result == null)
    148
    result = caseEModelElement(eReference);
    148
    result = caseEModelElement(eReference);
    112
    result = caseEModelElement(eOperation);
    Differences
    Expression1Expression2Difference
    eReferenceeOperationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EOperationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EOperation extend a common superclass
    112
    result = caseEModelElement(eOperation);
    149
    if (result == null)
                                                  
    150
    result = defaultCase(theEObject);
    150
    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
                                                                            
    151
    return result;
    115
    return result;
    Precondition Violations (7)
    Row Violation
    1Unmatched statement result=defaultCase(theEObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=caseEStructuralFeature(eReference); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    4Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    5Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    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
    7Clone fragment #1 returns variables result , while Clone fragment #2 returns variables