EGenericType eGenericType = getEGenericSuperTypes().get(index); EClass result = unwrap(eGenericType); // If this is just a proxy being resolved... // if (resolveProxy(result) == eClass) { // Force the raw type to be resolved so we don't resolve this endlessly. // eGenericType.getERawType(); } else { // Update the classifier and hence the raw type as normal. // eGenericType.setEClassifier(eClass); } return result;
EGenericType eGenericType = getEGenericExceptions().get(index); EClassifier result = unwrap(eGenericType); // If this is just a proxy being resolved... // if (resolveProxy(result) == eClassifier) { // Force the raw type to be resolved so we don't resolve this endlessly. // eGenericType.getERawType(); } else { // Update the classifier and hence the raw type as normal. // eGenericType.setEClassifier(eClassifier); } return result;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
Method name: EClass delegateSet(int, EClass) Method name: EClassifier delegateSet(int, EClassifier)
Number of AST nodes: 6 Number of AST nodes: 6
1
EGenericType eGenericType = getEGenericSuperTypes().get(index);
1
EGenericType eGenericType = getEGenericExceptions().get(index);
2
            EClass result = unwrap(eGenericType);
2
            EClassifier result = unwrap(eGenericType);
3
            // If this is just a proxy being resolved...
3
            // If this is just a proxy being resolved...
4
            //
4
            //
5
            if (resolveProxy(result) == eClass)
5
            if (resolveProxy(result) == eClassifier)
6
            {
6
            {
7
              // Force the raw type to be resolved so we don't resolve this endlessly.
7
              // Force the raw type to be resolved so we don't resolve this endlessly.
8
              //
8
              //
9
              eGenericType.getERawType();
9
              eGenericType.getERawType();
10
            }
10
            }
11
            else
11
            else
12
            {
12
            {
13
              // Update the classifier and hence the raw type as normal.
13
              // Update the classifier and hence the raw type as normal.
14
              //
14
              //
15
              eGenericType.setEClassifier(eClass);
15
              eGenericType.setEClassifier(eClassifier);
16
            }
16
            }
17
            return result;
17
            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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EGenericType eGenericType = getEGenericSuperTypes().get(index);
    1
    EGenericType eGenericType = getEGenericSuperTypes().get(index);
    1
    EGenericType eGenericType = getEGenericExceptions().get(index);
    Differences
    Expression1Expression2Difference
    getEGenericSuperTypesgetEGenericExceptionsMETHOD_INVOCATION_NAME_MISMATCH
    1
    EGenericType eGenericType = getEGenericExceptions().get(index);
                                                                                          
    2
    EClassifier result = unwrap(eGenericType);
    Preondition Violations
    Unmatched statement EClassifier result=unwrap(eGenericType); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    EClassifier result = unwrap(eGenericType);
    2
    EClass result = unwrap(eGenericType);
    2
    EClass result = unwrap(eGenericType);
    Preondition Violations
    Unmatched statement EClass result=unwrap(eGenericType); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    3
    if (resolveProxy(result) == eClass)
    3
    if (resolveProxy(result) == eClass)
    3
    if (resolveProxy(result) == eClassifier)
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    eClasseClassifierVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    eClasseClassifierVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable result does not match with type org.eclipse.emf.ecore.EClassifier of variable result
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    3
    if (resolveProxy(result) == eClassifier)
    4
    eGenericType.getERawType();
    4
    eGenericType.getERawType();
    else
    else
    5
    eGenericType.setEClassifier(eClass);
    5
    eGenericType.setEClassifier(eClass);
    5
    eGenericType.setEClassifier(eClassifier);
    Differences
    Expression1Expression2Difference
    eClasseClassifierVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    5
    eGenericType.setEClassifier(eClassifier);
                                      
    6
    return result;
    Preondition Violations
    Unmatched return result;
    6
    return result;
    6
    return result;
    6
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (8)
    Row Violation
    1Unmatched statement EClassifier result=unwrap(eGenericType); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement EClass result=unwrap(eGenericType); 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.EClass of variable result does not match with type org.eclipse.emf.ecore.EClassifier of variable result
    4Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    5Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    6Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier
    7Unmatched return result;
    8Unmatched return result;