Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot); if (secondaryMappedObjectsCollection.size() == 1) { secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next()); } int count = 0;
Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot); if (secondaryMappedObjectsCollection.size() == 1) { secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next()); } int count = 0;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/presentation/MappingEditor.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/presentation/MappingEditor.java
Method name: Object getColumnImage(Object, int) Method name: boolean hasDropDownEditor(Object, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot);
1
Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot);
2
          if (secondaryMappedObjectsCollection.size() == 1)
2
              if (secondaryMappedObjectsCollection.size() == 1)
3
          {
3
          
4
    {
4
            secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
5
                secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
5
          }
6
          
7
    }
6
          int count = 0;
8
              int count = 0;
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 the same java file
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6967.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot);
    19
    Collection<?> secondaryMappedObjectsCollection = getSecondaryMappedObjects(mappingRoot);
    23
    if (secondaryMappedObjectsCollection.size() == 1)
    23
    if (secondaryMappedObjectsCollection.size() == 1)
    20
    if (secondaryMappedObjectsCollection.size() == 1)
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable secondaryMappedObjectsCollection does not match with type java.util.Collection<> of variable secondaryMappedObjectsCollection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    20
    if (secondaryMappedObjectsCollection.size() == 1)
    24
    secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
    24
    secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
    21
    secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
    Differences
    Expression1Expression2Difference
    VARIABLE_TYPE_MISMATCH
    java.util.Iterator<>java.util.Iterator<>VARIABLE_TYPE_MISMATCH
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression secondaryMappedObjectsCollection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression secondaryMappedObjectsCollection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type of variable secondaryMappedObjectsCollection.iterator().next() does not match with type of variable secondaryMappedObjectsCollection.iterator().next()
    • Make classes and extend a common superclass
    Expression secondaryMappedObjectsCollection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression secondaryMappedObjectsCollection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.Iterator<> of variable secondaryMappedObjectsCollection.iterator() does not match with type java.util.Iterator<> of variable secondaryMappedObjectsCollection.iterator()
    • Make classes java.util.Iterator<> and java.util.Iterator<> extend a common superclass
    Type java.util.Collection<> of variable secondaryMappedObjectsCollection does not match with type java.util.Collection<> of variable secondaryMappedObjectsCollection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    21
    secondaryMappedObjectsCollection = mappingDomain.getChildren(secondaryMappedObjectsCollection.iterator().next());
    25
    int count = 0;
    22
    int count = 0;
    Precondition Violations (9)
    Row Violation
    1Type java.util.Collection<> of variable secondaryMappedObjectsCollection does not match with type java.util.Collection<> of variable secondaryMappedObjectsCollection
    2Expression secondaryMappedObjectsCollection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression secondaryMappedObjectsCollection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type of variable secondaryMappedObjectsCollection.iterator().next() does not match with type of variable secondaryMappedObjectsCollection.iterator().next()
    5Expression secondaryMappedObjectsCollection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression secondaryMappedObjectsCollection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.util.Iterator<> of variable secondaryMappedObjectsCollection.iterator() does not match with type java.util.Iterator<> of variable secondaryMappedObjectsCollection.iterator()
    8Type java.util.Collection<> of variable secondaryMappedObjectsCollection does not match with type java.util.Collection<> of variable secondaryMappedObjectsCollection
    9Clone fragment #1 returns variables secondaryMappedObjectsCollection, count , while Clone fragment #2 returns variables secondaryMappedObjectsCollection, count