if (validator.isValid(entry.getEStructuralFeature())) { if (collection.contains(entry.getValue())) { return false; } else { throw new IllegalArgumentException("The multiplicity constraint is violated"); } }
if (validator.isValid(entry.getEStructuralFeature())) { if (collection.contains(entry.getValue())) { return false; } else { throw new IllegalArgumentException("The multiplicity constraint is violated"); } }
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/DelegatingFeatureMap.java
Method name: boolean addAll(int, EStructuralFeature, Collection) Method name: boolean addAll(int, EStructuralFeature, Collection)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (validator.isValid(entry.getEStructuralFeature()))
1
if (validator.isValid(entry.getEStructuralFeature()))
2
          {
2
          {
3
            if (collection.contains(entry.getValue()))
3
            if (collection.contains(entry.getValue()))
4
            {
4
            {
5
              return false;
5
              return false;
6
            }
6
            }
7
            else
7
            else
8
            {
8
            {
9
              throw new IllegalArgumentException("The multiplicity constraint is violated");
9
              throw new IllegalArgumentException("The multiplicity constraint is violated");
10
            }
10
            }
11
          }
11
          }
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 in different classes having the same super class
Number of node comparisons11
  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)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    if (validator.isValid(entry.getEStructuralFeature()))
    24
    if (validator.isValid(entry.getEStructuralFeature()))
    26
    if (collection.contains(entry.getValue()))
    26
    if (collection.contains(entry.getValue()))
    25
    if (collection.contains(entry.getValue()))
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    25
    if (collection.contains(entry.getValue()))
    27
    return false;
    27
    return false;
    26
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    26
    return false;
    else
    else
    28
    throw new IllegalArgumentException("The multiplicity constraint is violated");
    27
    throw new IllegalArgumentException("The multiplicity constraint is violated");
    Precondition Violations (3)
    Row Violation
    1Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection
    2Conditional return false;
    3Conditional return false;