Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { if (count == index) { remove(i); return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); } ++count; }
Entry entry = delegateGet(i); if (validator.isValid(entry.getEStructuralFeature())) { if (count == index) { return doSet(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/DelegatingFeatureMap.java
Method name: Object remove(EStructuralFeature, int) Method name: Object set(EStructuralFeature, int, Object)
Number of AST nodes: 6 Number of AST nodes: 5
1
Entry entry = entries[i];
1
Entry entry = 
2
delegateGet(i);
2
      if (validator.isValid(entry.getEStructuralFeature()))
3
        if (validator.isValid(entry.getEStructuralFeature()))
3
      {
4
      
5
  {
4
        if (count == index)
6
          if (count == index)
5
        {
7
          {
6
          remove(i);
8
          
7
          return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
9
  return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
8
        }
10
          }
9
        ++count;
11
          ++count;
10
      }
12
        }
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 in different classes having the same super 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.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    5
    Entry entry = entries[i];
    5
    Entry entry = entries[i];
    9
    Entry entry = delegateGet(i);
    Differences
    Expression1Expression2Difference
    entries[i]delegateGet(i)TYPE_COMPATIBLE_REPLACEMENT
    9
    Entry entry = delegateGet(i);
    6
    if (validator.isValid(entry.getEStructuralFeature()))
    10
    if (validator.isValid(entry.getEStructuralFeature()))
    7
    if (count == index)
    11
    if (count == index)
    8
    remove(i);
                              
    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();
                                                                                                                                                        
                                                                                                                                                                                                                  
    12
    return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
    Preondition Violations
    Unmatched return doSet(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object));
    12
    return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));
    10
    ++count;
    13
    ++count;
    Precondition Violations (4)
    Row Violation
    1Unmatched 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
    2Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    3Unmatched return doSet(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object));
    4Clone fragment #1 returns variables entry, count , while Clone fragment #2 returns variables count