for (int i = 0, size = delegateSize(); i < size; ++i) { Entry entry = delegateGet(i); if (validator.isValid(entry.getEStructuralFeature())) { throw new IllegalArgumentException("The multiplicity constraint is violated"); } }
for (int i = 0, size = delegateSize(); i < size; ++i) { Entry entry = delegateGet(i); if (validator.isValid(entry.getEStructuralFeature())) { 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/DelegatingFeatureMap.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
Method name: void add(EStructuralFeature, int, Object) Method name: boolean addAll(EStructuralFeature, int, Collection)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0, size = delegateSize(); i < size; ++i)
1
for (int i = 0, size = delegateSize(); i < size; ++i)
2
      {
2
      {
3
        Entry entry = delegateGet(i);
3
        Entry entry = delegateGet(i);
4
        if (validator.isValid(entry.getEStructuralFeature()))
4
        if (validator.isValid(entry.getEStructuralFeature()))
5
        {
5
        {
6
          throw new IllegalArgumentException("The multiplicity constraint is violated");
6
          throw new IllegalArgumentException("The multiplicity constraint is violated");
7
        }
7
        }
8
      }
8
      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {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.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    6
    for (int i = 0, size = delegateSize(); i < size; ++i)
    16
    for (int i = 0, size = delegateSize(); i < size; ++i)
    7
    Entry entry = delegateGet(i);
    17
    Entry entry = delegateGet(i);
    8
    if (validator.isValid(entry.getEStructuralFeature()))
    18
    if (validator.isValid(entry.getEStructuralFeature()))
    9
    throw new IllegalArgumentException("The multiplicity constraint is violated");
    19
    throw new IllegalArgumentException("The multiplicity constraint is violated");
    Precondition Violations (0)
    Row Violation