Object value = i.next(); result.append(convert(eDataType, value)); if (i.hasNext()) { result.append(", "); }
EGenericType eGenericSuperType = i.next(); result.append(EGenericTypeItemProvider.getText(eGenericSuperType)); if (i.hasNext()) { result.append(", "); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemPropertyDescriptor.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EClassItemProvider.java
Method name: String getText(Object) Method name: String getText(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
Object value = i.next();
1
EGenericType eGenericSuperType = i.next();
2
                result.append(convert(eDataType, value));
2
        result.append(EGenericTypeItemProvider.getText(eGenericSuperType));
3
                if (i.hasNext())
3
        if (i.hasNext())
4
                {
4
        {
5
                  result.append(", ");
5
          result.append(", ");
6
                }
6
        }
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.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1925.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    Object value = i.next();
    8
    Object value = i.next();
    Preondition Violations
    Unmatched statement Object value=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
                                                                                            
    16
    EGenericType eGenericSuperType = i.next();
    Preondition Violations
    Unmatched statement EGenericType eGenericSuperType=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16
    EGenericType eGenericSuperType = i.next();
    9
    result.append(convert(eDataType, value));
    9
    result.append(convert(eDataType, value));
    17
    result.append(EGenericTypeItemProvider.getText(eGenericSuperType));
    Differences
    Expression1Expression2Difference
    convertgetTextMETHOD_INVOCATION_NAME_MISMATCH
    convert(eDataType,value)EGenericTypeItemProvider.getText(eGenericSuperType)ARGUMENT_NUMBER_MISMATCH
    EGenericTypeItemProviderMISSING_METHOD_INVOCATION_EXPRESSION
    17
    result.append(EGenericTypeItemProvider.getText(eGenericSuperType));
    10
    if (i.hasNext())
    10
    if (i.hasNext())
    18
    if (i.hasNext())
    Differences
    Expression1Expression2Difference
    java.util.Iterator<>java.util.IteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Iterator<> of variable i does not match with type java.util.Iterator<org.eclipse.emf.ecore.EGenericType> of variable i
    • Make classes java.util.Iterator<> and java.util.Iterator extend a common superclass
    18
    if (i.hasNext())
    11
    result.append(", ");
    19
    result.append(", ");
    Precondition Violations (3)
    Row Violation
    1Unmatched statement Object value=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement EGenericType eGenericSuperType=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type java.util.Iterator<> of variable i does not match with type java.util.Iterator<org.eclipse.emf.ecore.EGenericType> of variable i