inputs = new ArrayList<EObject>(inputs); @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection; inputs.addAll(eObjects);
outputs = new ArrayList<EObject>(outputs); @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection; outputs.addAll(eObjects);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/provider/MappingItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/provider/MappingItemProvider.java
Method name: boolean prepare() Method name: boolean prepare()
Number of AST nodes: 3 Number of AST nodes: 3
1
inputs = new ArrayList<EObject>(inputs);
1
outputs = new ArrayList<EObject>(outputs);
2
              @SuppressWarnings("unchecked")
2
              @SuppressWarnings("unchecked")
3
              Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
3
              Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
4
              inputs.addAll(eObjects);
4
              outputs.addAll(eObjects);
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.0
Clones locationClones are in the same method
Number of node comparisons9
  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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    inputs = new ArrayList<EObject>(inputs);
    5
    inputs = new ArrayList<EObject>(inputs);
    8
    outputs = new ArrayList<EObject>(outputs);
    Differences
    Expression1Expression2Difference
    inputsoutputsVARIABLE_NAME_MISMATCH
    inputsoutputsVARIABLE_NAME_MISMATCH
    8
    outputs = new ArrayList<EObject>(outputs);
    6
    @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
    6
    @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
    9
    @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable mappedObjectsCollection does not match with type java.util.Collection<> of variable mappedObjectsCollection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    9
    @SuppressWarnings("unchecked") Collection<EObject> eObjects = (Collection<EObject>)mappedObjectsCollection;
    7
    inputs.addAll(eObjects);
    7
    inputs.addAll(eObjects);
    10
    outputs.addAll(eObjects);
    Differences
    Expression1Expression2Difference
    inputsoutputsVARIABLE_NAME_MISMATCH
    10
    outputs.addAll(eObjects);
    Precondition Violations (1)
    Row Violation
    1Type java.util.Collection<> of variable mappedObjectsCollection does not match with type java.util.Collection<> of variable mappedObjectsCollection