StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("["); EList<EGenericType> eGenericExceptions = getEGenericExceptions(); for (int i = 0, size = delegateSize(); i < size; ) { stringBuffer.append(String.valueOf(unwrap(eGenericExceptions.get(i)))); if (++i < size) { stringBuffer.append(", "); } } stringBuffer.append("]"); return stringBuffer.toString();
StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("["); EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes(); for (int i = 0, size = delegateSize(); i < size; ) { stringBuffer.append(String.valueOf(unwrap(eGenericSuperTypes.get(i)))); if (++i < size) { stringBuffer.append(", "); } } stringBuffer.append("]"); return stringBuffer.toString();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java
Method name: String delegateToString() Method name: String delegateToString()
Number of AST nodes: 9 Number of AST nodes: 9
1
StringBuffer stringBuffer = new StringBuffer();
1
StringBuffer stringBuffer = new StringBuffer();
2
            stringBuffer.append("[");
2
            stringBuffer.append("[");
3
            EList<EGenericType> eGenericExceptions = getEGenericExceptions();
3
            EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
4
            for (int i = 0, size = delegateSize(); i < size; )
4
            for (int i = 0, size = delegateSize(); i < size; )
5
            {
5
            {
6
              stringBuffer.append(String.valueOf(unwrap(eGenericExceptions.get(i))));
6
              stringBuffer.append(String.valueOf(unwrap(eGenericSuperTypes.get(i))));
7
              if (++i < size)
7
              if (++i < size)
8
              {
8
              {
9
                stringBuffer.append(", ");
9
                stringBuffer.append(", ");
10
              }
10
              }
11
            }
11
            }
12
            stringBuffer.append("]");
12
            stringBuffer.append("]");
13
            return stringBuffer.toString();
13
            return stringBuffer.toString();
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 different classes having the same super class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StringBuffer stringBuffer = new StringBuffer();
    1
    StringBuffer stringBuffer = new StringBuffer();
    2
    stringBuffer.append("[");
    2
    stringBuffer.append("[");
    3
    EList<EGenericType> eGenericExceptions = getEGenericExceptions();
    3
    EList<EGenericType> eGenericExceptions = getEGenericExceptions();
    3
    EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
    Differences
    Expression1Expression2Difference
    eGenericExceptionseGenericSuperTypesVARIABLE_NAME_MISMATCH
    getEGenericExceptionsgetEGenericSuperTypesMETHOD_INVOCATION_NAME_MISMATCH
    3
    EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
    4
    for (int i = 0, size = delegateSize(); i < size; )
    4
    for (int i = 0, size = delegateSize(); i < size; )
    4
    for (int i = 0, size = delegateSize(); i < size; )
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EClassifierorg.eclipse.emf.ecore.EClassVARIABLE_TYPE_MISMATCH
    eGenericExceptionseGenericSuperTypesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression unwrap(eGenericExceptions.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression unwrap(eGenericSuperTypes.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericExceptions.get(i)) does not match with type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericSuperTypes.get(i))
    • Make classes org.eclipse.emf.ecore.EClassifier and org.eclipse.emf.ecore.EClass extend a common superclass
    4
    for (int i = 0, size = delegateSize(); i < size; )
    5
    stringBuffer.append(String.valueOf(unwrap(eGenericExceptions.get(i))));
    5
    stringBuffer.append(String.valueOf(unwrap(eGenericExceptions.get(i))));
    5
    stringBuffer.append(String.valueOf(unwrap(eGenericSuperTypes.get(i))));
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EClassifierorg.eclipse.emf.ecore.EClassVARIABLE_TYPE_MISMATCH
    eGenericExceptionseGenericSuperTypesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression unwrap(eGenericExceptions.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression unwrap(eGenericSuperTypes.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericExceptions.get(i)) does not match with type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericSuperTypes.get(i))
    • Make classes org.eclipse.emf.ecore.EClassifier and org.eclipse.emf.ecore.EClass extend a common superclass
    5
    stringBuffer.append(String.valueOf(unwrap(eGenericSuperTypes.get(i))));
    6
    if (++i < size)
    6
    if (++i < size)
    7
    stringBuffer.append(", ");
    7
    stringBuffer.append(", ");
    8
    stringBuffer.append("]");
    8
    stringBuffer.append("]");
    9
    return stringBuffer.toString();
    9
    return stringBuffer.toString();
    Precondition Violations (6)
    Row Violation
    1Expression unwrap(eGenericExceptions.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression unwrap(eGenericSuperTypes.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericExceptions.get(i)) does not match with type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericSuperTypes.get(i))
    4Expression unwrap(eGenericExceptions.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression unwrap(eGenericSuperTypes.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.eclipse.emf.ecore.EClassifier of variable unwrap(eGenericExceptions.get(i)) does not match with type org.eclipse.emf.ecore.EClass of variable unwrap(eGenericSuperTypes.get(i))