FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); Entry [] entries = (Entry[])data; for (int i = 0; i < size; ++i) { Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { return false; } } return true;
FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), entryFeature); Entry [] entries = (Entry[])data; for (int i = 0; i < size; ++i) { Entry otherEntry = entries[i]; if (validator.isValid(otherEntry.getEStructuralFeature()) && i != index) { 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/BasicFeatureMap.java
Method name: boolean isEmpty(EStructuralFeature) Method name: Entry set(int, Entry)
Number of AST nodes: 7 Number of AST nodes: 6
1
FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);
1
FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), entryFeature);
2
    Entry [] entries = (Entry[])data;
2
      Entry [] entries = (Entry[])data;
3
    for (int i = 0; i < size; ++i)
3
      for (int i = 0; i < size; ++i)
4
    {
4
    
5
  {
5
      Entry entry = entries[i];
6
        Entry otherEntry = entries[i];
6
      if (validator.isValid(entry.getEStructuralFeature()))
7
        if (validator.isValid(otherEntry.getEStructuralFeature())
7
      {
8
        return false
8
 && i != index)
9
        {
9
;
10
          throw new IllegalArgumentException("The multiplicity constraint is violated");
10
      }
11
    
11
    }
12
    }
12
    return true;
13
      }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons1