Object value = i.next(); result.append(convert(eDataType, value)); if (i.hasNext()) { result.append(", "); }
ETypeParameter eTypeParameter = i.next(); result.append(ETypeParameterItemProvider.getText(eTypeParameter)); 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
ETypeParameter eTypeParameter = i.next();
2
                result.append(convert(eDataType, value));
2
        result.append(ETypeParameterItemProvider.getText(eTypeParameter));
3
                if (i.hasNext())
3
        if (i.hasNext())
4
                {
4
        
5
  
5
{
6
                result.append(", ");
6
          result.append(", ");
7
                }
7
        }
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)1838.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    8
    ETypeParameter eTypeParameter = i.next();
    Preondition Violations
    Unmatched statement ETypeParameter eTypeParameter=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    ETypeParameter eTypeParameter = i.next();
    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
                                                      
    9
    result.append(convert(eDataType, value));
    9
    result.append(convert(eDataType, value));
    9
    result.append(ETypeParameterItemProvider.getText(eTypeParameter));
    Differences
    Expression1Expression2Difference
    convertgetTextMETHOD_INVOCATION_NAME_MISMATCH
    convert(eDataType,value)ETypeParameterItemProvider.getText(eTypeParameter)ARGUMENT_NUMBER_MISMATCH
    ETypeParameterItemProviderMISSING_METHOD_INVOCATION_EXPRESSION
    9
    result.append(ETypeParameterItemProvider.getText(eTypeParameter));
    10
    if (i.hasNext())
    10
    if (i.hasNext())
    10
    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.ETypeParameter> of variable i
    • Make classes java.util.Iterator<> and java.util.Iterator extend a common superclass
    10
    if (i.hasNext())
    11
    result.append(", ");
    11
    result.append(", ");
    Precondition Violations (3)
    Row Violation
    1Unmatched statement ETypeParameter eTypeParameter=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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
    3Type java.util.Iterator<> of variable i does not match with type java.util.Iterator<org.eclipse.emf.ecore.ETypeParameter> of variable i