EAttribute eAttribute = (EAttribute)theEObject; T result = caseEAttribute(eAttribute); if (result == null) result = caseEStructuralFeature(eAttribute); if (result == null) result = caseETypedElement(eAttribute); if (result == null) result = caseENamedElement(eAttribute); if (result == null) result = caseEModelElement(eAttribute); if (result == null) result = defaultCase(theEObject); return result;
EStructuralFeature eStructuralFeature = (EStructuralFeature)theEObject; T result = caseEStructuralFeature(eStructuralFeature); if (result == null) result = caseETypedElement(eStructuralFeature); if (result == null) result = caseENamedElement(eStructuralFeature); if (result == null) result = caseEModelElement(eStructuralFeature); 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
EAttribute eAttribute = (EAttribute)theEObject;
1
E
2
        T result = caseEAttribute(eAttribute);
3
        if (result == null) result = caseE
2
StructuralFeature eStructuralFeature = (EStructuralFeature)theEObject;
4
StructuralFeature(eAttribute);
3
        T result = caseEStructuralFeature(eStructuralFeature);
5
        if (result == null) result = caseETypedElement(eAttribute);
4
        if (result == null) result = caseETypedElement(eStructuralFeature);
6
        if (result == null) result = caseENamedElement(eAttribute);
5
        if (result == null) result = caseENamedElement(eStructuralFeature);
7
        if (result == null) result = caseEModelElement(eAttribute);
6
        if (result == null) result = caseEModelElement(eStructuralFeature);
8
        if (result == null) result = defaultCase(theEObject);
7
        if (result == null) result = defaultCase(theEObject);
9
        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 statements5
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    EAttribute eAttribute = (EAttribute)theEObject;
                                                                                                    
    4
    T result = caseEAttribute(eAttribute);
                                                                                  
                                                                                                                                                        
    153
    EStructuralFeature eStructuralFeature = (EStructuralFeature)theEObject;
                                                                                                                      
    154
    T result = caseEStructuralFeature(eStructuralFeature);
    5
    if (result == null)
    155
    if (result == null)
    6
    result = caseEStructuralFeature(eAttribute);
    6
    result = caseEStructuralFeature(eAttribute);
    Preondition Violations
    Unmatched statement result=caseEStructuralFeature(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
                                                                                                        
    156
    result = caseETypedElement(eStructuralFeature);
    Preondition Violations
    Unmatched statement result=caseETypedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    156
    result = caseETypedElement(eStructuralFeature);
    7
    if (result == null)
    157
    if (result == null)
    8
    result = caseETypedElement(eAttribute);
    8
    result = caseETypedElement(eAttribute);
    Preondition Violations
    Unmatched statement result=caseETypedElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
                                                                                                        
    158
    result = caseENamedElement(eStructuralFeature);
    Preondition Violations
    Unmatched statement result=caseENamedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    158
    result = caseENamedElement(eStructuralFeature);
    9
    if (result == null)
    159
    if (result == null)
    10
    result = caseENamedElement(eAttribute);
    10
    result = caseENamedElement(eAttribute);
    Preondition Violations
    Unmatched statement result=caseENamedElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                      
                                                                                                        
    160
    result = caseEModelElement(eStructuralFeature);
    Preondition Violations
    Unmatched statement result=caseEModelElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    160
    result = caseEModelElement(eStructuralFeature);
    11
    if (result == null)
    161
    if (result == null)
    12
    result = caseEModelElement(eAttribute);
    12
    result = caseEModelElement(eAttribute);
    Preondition Violations
    Unmatched statement result=caseEModelElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                      
                                                                            
    162
    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
    162
    result = defaultCase(theEObject);
    13
    if (result == null)
                                                
    14
    result = defaultCase(theEObject);
    14
    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
                                                                          
    15
    return result;
    163
    return result;
    Precondition Violations (9)
    Row Violation
    1Unmatched statement result=caseEStructuralFeature(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=caseETypedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=caseETypedElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result=caseENamedElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement result=caseENamedElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement result=caseEModelElement(eStructuralFeature); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement result=caseEModelElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    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