for (int i = 0; i < size; ++i) { Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); } } return null;
for (int i = 0; i < size; ++i) { Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { Object value = entry.getValue(); result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value); } }
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 set(EStructuralFeature, int, Object) Method name: T[] toArray(EStructuralFeature, T[], boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int i = 0; i < size; ++i)
1
for (int i = 0; i < size; ++i)
2
      {
2
      {
3
        Entry entry = entries[i];
3
        Entry entry = entries[i];
4
        if (validator.isValid(entry.getEStructuralFeature()))
4
        if (validator.isValid(entry.getEStructuralFeature()))
5
        {
5
        {
6
          return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getV
6
          Object value = entry.getValue();
7
alue();
7
          result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);
8
        }
8
        }
9
      }
9
      }
10
      return null;
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.9
Clones locationClones are declared in the same class
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    16
    for (int i = 0; i < size; ++i)
    9
    for (int i = 0; i < size; ++i)
    17
    Entry entry = entries[i];
    10
    Entry entry = entries[i];
    18
    if (validator.isValid(entry.getEStructuralFeature()))
    11
    if (validator.isValid(entry.getEStructuralFeature()))
                                                                        
    12
    Object value = entry.getValue();
    Preondition Violations
    Unmatched statement Object value=entry.getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    Object value = entry.getValue();
                                                                                                                                                                
    13
    result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);
    Preondition Violations
    Unmatched statement result.add(resolve ? resolveProxy(feature,i,result.size(),value) : value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13
    result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);
    19
    return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    19
    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();
                                                                                                                                                          
    20
    return null;
    20
    return null;
    Preondition Violations
    Unmatched return null;
                                    
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Object value=entry.getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result.add(resolve ? resolveProxy(feature,i,result.size(),value) : value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched 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
    4Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();
    5Unmatched return null;
    6Clone fragment #1 returns variables entry , while Clone fragment #2 returns variables entry, i