for (Iterator<?> i = collection.iterator(); i.hasNext(); ) { if (!contains(feature, i.next())) { return false; } } return true;
for (Iterator<?> i = collection.iterator(); i.hasNext(); ) { if (!basicContains(feature, i.next())) { return false; } } return true;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
Method name: boolean containsAll(EStructuralFeature, Collection) Method name: boolean basicContainsAll(EStructuralFeature, Collection)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (Iterator<?> i = collection.iterator(); i.hasNext(); )
1
for (Iterator<?> i = collection.iterator(); i.hasNext(); )
2
    {
2
    {
3
      if (!contains(feature, i.next()))
3
      if (!basicContains(feature, i.next()))
4
      {
4
      {
5
        return false;
5
        return false;
6
      }
6
      }
7
    }
7
    }
8
    return true;
8
    return true;
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.4
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (!contains(feature, i.next()))
    2
    if (!contains(feature, i.next()))
    2
    if (!basicContains(feature, i.next()))
    Differences
    Expression1Expression2Difference
    containsbasicContainsMETHOD_INVOCATION_NAME_MISMATCH
    VARIABLE_TYPE_MISMATCH
    java.util.Iterator<>java.util.Iterator<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type of variable i.next() does not match with type of variable i.next()
    • Make classes and extend a common superclass
    Type java.util.Iterator<> of variable i does not match with type java.util.Iterator<> of variable i
    • Make classes java.util.Iterator<> and java.util.Iterator<> extend a common superclass
    2
    if (!basicContains(feature, i.next()))
    3
    return false;
    3
    return false;
    Precondition Violations (2)
    Row Violation
    1Type of variable i.next() does not match with type of variable i.next()
    2Type java.util.Iterator<> of variable i does not match with type java.util.Iterator<> of variable i