int index = 0; for (EGenericType eGenericType : getEGenericSuperTypes()) { if (object == unwrap(eGenericType)) { return index; } ++index; } return -1;
int index = 0; for (EGenericType eGenericType : getEGenericExceptions()) { if (object == unwrap(eGenericType)) { return index; } ++index; } return -1;
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: int delegateIndexOf(Object) Method name: int delegateIndexOf(Object)
Number of AST nodes: 6 Number of AST nodes: 6
1
int index = 0;
1
int index = 0;
2
            for (EGenericType eGenericType : getEGenericSuperTypes())
2
            for (EGenericType eGenericType : getEGenericExceptions())
3
            {
3
            {
4
              if (object == unwrap(eGenericType))
4
              if (object == unwrap(eGenericType))
5
              {
5
              {
6
                return index;
6
                return index;
7
              }
7
              }
8
              ++index;
8
              ++index;
9
            }
9
            }
10
            return -1;
10
            return -1;
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 comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int index = 0;
    1
    int index = 0;
    2
    for (EGenericType eGenericType : getEGenericSuperTypes())
    2
    for (EGenericType eGenericType : getEGenericSuperTypes())
    2
    for (EGenericType eGenericType : getEGenericExceptions())
    Differences
    Expression1Expression2Difference
    getEGenericSuperTypesgetEGenericExceptionsMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    2
    for (EGenericType eGenericType : getEGenericExceptions())
    3
    if (object == unwrap(eGenericType))
    3
    if (object == unwrap(eGenericType))
    3
    if (object == unwrap(eGenericType))
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EClassifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EClassifier extend a common superclass
    3
    if (object == unwrap(eGenericType))
    4
    return index;
    4
    return index;
    5
    ++index;
    5
    ++index;
    6
    return -1;
    6
    return -1;
    Precondition Violations (6)
    Row Violation
    1Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)
    4Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression unwrap(eGenericType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericType) does not match with type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericType)