EEnum eEnum = (EEnum)theEObject; T result = caseEEnum(eEnum); if (result == null) result = caseEDataType(eEnum); if (result == null) result = caseEClassifier(eEnum); if (result == null) result = caseENamedElement(eEnum); if (result == null) result = caseEModelElement(eEnum); if (result == null) result = defaultCase(theEObject); return result;
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;
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: 13
1
EEnum eEnum = (EEnum)theEObject;
1
EAttribute eAttribute = (EAttribute)theEObject;
2
        T result = caseEEnum(eEnum);
2
        T result = caseEAttribute(eAttribute);
3
        if (result == null) result = caseEDataType(eEnum);
3
        if (result == null) result = caseEStructuralFeature(eAttribute);
4
        if (result == null) result = caseEClassifier(eEnum);
4
        if (result == null) result = caseETypedElement(eAttribute);
5
        if (result == null) result = caseENamedElement(eEnum);
5
        if (result == null) result = caseENamedElement(eAttribute);
6
        if (result == null) result = caseEModelElement(eEnum);
6
        if (result == null) result = caseEModelElement(eAttribute);
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)1.0
Clones locationClones are in the same method
Number of node comparisons80
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                    
    3
    EAttribute eAttribute = (EAttribute)theEObject;
                                                                                  
    4
    T result = caseEAttribute(eAttribute);
    59
    EEnum eEnum = (EEnum)theEObject;
                                                                        
    60
    T result = caseEEnum(eEnum);
                                                                
    61
    if (result == null)
    13
    if (result == null)
                                                                          
    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
    14
    result = defaultCase(theEObject);
    62
    result = caseEDataType(eEnum);
    62
    result = caseEDataType(eEnum);
    Preondition Violations
    Unmatched statement result=caseEDataType(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                    
    63
    if (result == null)
    11
    if (result == null)
                                                                                      
    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
    12
    result = caseEModelElement(eAttribute);
    64
    result = caseEClassifier(eEnum);
    64
    result = caseEClassifier(eEnum);
    Preondition Violations
    Unmatched statement result=caseEClassifier(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    65
    if (result == null)
    9
    if (result == null)
    66
    result = caseENamedElement(eEnum);
    66
    result = caseENamedElement(eEnum);
    10
    result = caseENamedElement(eAttribute);
    Differences
    Expression1Expression2Difference
    eEnumeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EEnumorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EEnum of variable eEnum does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EEnum and org.eclipse.emf.ecore.EAttribute extend a common superclass
    10
    result = caseENamedElement(eAttribute);
    67
    if (result == null)
    7
    if (result == null)
                                                                                    
    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
    8
    result = caseETypedElement(eAttribute);
    68
    result = caseEModelElement(eEnum);
    68
    result = caseEModelElement(eEnum);
    Preondition Violations
    Unmatched statement result=caseEModelElement(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
    69
    if (result == null)
    5
    if (result == null)
                                                                                              
    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
    6
    result = caseEStructuralFeature(eAttribute);
    70
    result = defaultCase(theEObject);
    70
    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
                                                                          
    71
    return result;
    15
    return result;
    Precondition Violations (9)
    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=caseEDataType(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=caseEModelElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result=caseEClassifier(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Type org.eclipse.emf.ecore.EEnum of variable eEnum does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    6Unmatched statement result=caseETypedElement(eAttribute); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement result=caseEModelElement(eEnum); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement result=caseEStructuralFeature(eAttribute); 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