for (EGenericType eGenericSuperType : eClass.getEGenericSuperTypes()) { if (eGenericSuperType.getEClassifier() == eSuperType) { eGenericTypes.add(eGenericSuperType); continue LOOP; } } EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType(); eGenericType.setEClassifier(eSuperType); for (int i = 0, size = eSuperType.getETypeParameters().size(); i < size; ++i) { eGenericType.getETypeArguments().add(EcoreFactory.eINSTANCE.createEGenericType()); } eGenericTypes.add(eGenericType);
for (EGenericType eGenericException : eOperation.getEGenericExceptions()) { if (eGenericException.getEClassifier() == eException) { eGenericTypes.add(eGenericException); continue LOOP; } } EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType(); eGenericType.setEClassifier(eException); for (int i = 0, size = eException.getETypeParameters().size(); i < size; ++i) { eGenericType.getETypeArguments().add(EcoreFactory.eINSTANCE.createEGenericType()); } eGenericTypes.add(eGenericType);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EClassItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EOperationItemProvider.java
Method name: void setPropertyValue(Object, Object) Method name: void setPropertyValue(Object, Object)
Number of AST nodes: 9 Number of AST nodes: 9
1
for (EGenericType eGenericSuperType : eClass.getEGenericSuperTypes())
1
for (EGenericType eGenericException : eOperation.getEGenericExceptions())
2
               {
2
               {
3
                 if (eGenericSuperType.getEClassifier() == eSuperType)
3
                 if (eGenericException.getEClassifier() == eException)
4
                 {
4
                 {
5
                   eGenericTypes.add(eGenericSuperType);
5
                   eGenericTypes.add(eGenericException);
6
                   continue LOOP;
6
                   continue LOOP;
7
                 }
7
                 }
8
               }
8
               }
9
               EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
9
               EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
10
               eGenericType.setEClassifier(eSuperType);
10
               eGenericType.setEClassifier(eException);
11
               for (int i = 0, size = eSuperType.getETypeParameters().size(); i < size; ++i)
11
               for (int i = 0, size = eException.getETypeParameters().size(); i < size; ++i)
12
               {
12
               {
13
                 eGenericType.getETypeArguments().add(EcoreFactory.eINSTANCE.createEGenericType());
13
                 eGenericType.getETypeArguments().add(EcoreFactory.eINSTANCE.createEGenericType());
14
               }
14
               }
15
               eGenericTypes.add(eGenericType);
15
               eGenericTypes.add(eGenericType);
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)23.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (eGenericSuperType.getEClassifier() == eSuperType)
    9
    if (eGenericSuperType.getEClassifier() == eSuperType)
    9
    if (eGenericException.getEClassifier() == eException)
    Differences
    Expression1Expression2Difference
    eGenericSuperTypeeGenericExceptionVARIABLE_NAME_MISMATCH
    eSuperTypeeExceptionVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    eGenericSuperTypeeGenericExceptionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable eSuperType does not match with type org.eclipse.emf.ecore.EClassifier of variable eException
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    9
    if (eGenericException.getEClassifier() == eException)
    10
    eGenericTypes.add(eGenericSuperType);
    10
    eGenericTypes.add(eGenericSuperType);
    10
    eGenericTypes.add(eGenericException);
    Differences
    Expression1Expression2Difference
    eGenericSuperTypeeGenericExceptionVARIABLE_NAME_MISMATCH
    10
    eGenericTypes.add(eGenericException);
    11
    continue LOOP;
    11
    continue LOOP;
    11
    continue LOOP;
    Preondition Violations
    Statement continue LOOP; without innermost loop
    Statement continue LOOP; without innermost loop
    11
    continue LOOP;
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.EClass of variable eSuperType does not match with type org.eclipse.emf.ecore.EClassifier of variable eException
    2Statement continue LOOP; without innermost loop
    3Statement continue LOOP; without innermost loop