Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { if (count == index) { remove(i); return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); } ++count; }
Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { if (count == index) { return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object)); } ++count; }
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: Object remove(EStructuralFeature, int) Method name: Object setUnique(EStructuralFeature, int, Object)
Number of AST nodes: 6 Number of AST nodes: 5
1
Entry entry = entries[i];
1
Entry entry = entries[i];
2
      if (validator.isValid(entry.getEStructuralFeature()))
2
        if (validator.isValid(entry.getEStructuralFeature()))
3
      {
3
      
4
  {
4
        if (count == index)
5
          if (count == index)
5
        {
6
          {
6
          remove(i);
7
          
7
          return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
8
  return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
8
        }
9
          }
9
        ++count;
10
          ++count;
10
      }
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.3
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    5
    Entry entry = entries[i];
    6
    Entry entry = entries[i];
    6
    if (validator.isValid(entry.getEStructuralFeature()))
    7
    if (validator.isValid(entry.getEStructuralFeature()))
    7
    if (count == index)
    8
    if (count == index)
    8
    remove(i);
                              
                                                                                                                                                                                                                        
    9
    return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
    Preondition Violations
    Unmatched return setUnique(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object));
    9
    return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
    9
    return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    9
    return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    Preondition Violations
    Unmatched statement return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
                                                                                                                                                        
    10
    ++count;
    10
    ++count;
    Precondition Violations (4)
    Row Violation
    1Unmatched return setUnique(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object));
    2Unmatched statement return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    4Clone fragment #1 returns variables entry, count , while Clone fragment #2 returns variables count