FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex - 1); EStructuralFeature entryFeature = entry.getEStructuralFeature(); if (isIncludedEntry(entryFeature) && entry.getValue() != null) { return true; } else { --valueListIndex; }
FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex); EStructuralFeature entryFeature = entry.getEStructuralFeature(); if (isIncludedEntry(entryFeature) && entry.getValue() != null) { return true; } else { ++valueListIndex; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java
Method name: boolean scanPrevious() Method name: boolean scanNext()
Number of AST nodes: 5 Number of AST nodes: 5
1
FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex - 1);
1
FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex);
2
          EStructuralFeature entryFeature = entry.getEStructuralFeature();
2
          EStructuralFeature entryFeature = entry.getEStructuralFeature();
3
          if (isIncludedEntry(entryFeature) && entry.getValue() != null)
3
          if (isIncludedEntry(entryFeature) && entry.getValue() != null)
4
          {
4
          {
5
            return true;
5
            return true;
6
          }
6
          }
7
          else
7
          else
8
          {
8
          {
9
            --valueListIndex;
9
            ++valueListIndex;
10
          }
10
          }
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 comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex - 1);
    3
    FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex - 1);
    3
    FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex);
    Differences
    Expression1Expression2Difference
    valueListIndex - 1valueListIndexTYPE_COMPATIBLE_REPLACEMENT
    3
    FeatureMap.Entry entry = (FeatureMap.Entry)valueList.get(valueListIndex);
    4
    EStructuralFeature entryFeature = entry.getEStructuralFeature();
    4
    EStructuralFeature entryFeature = entry.getEStructuralFeature();
    5
    if (isIncludedEntry(entryFeature) && entry.getValue() != null)
    5
    if (isIncludedEntry(entryFeature) && entry.getValue() != null)
    6
    return true;
    6
    return true;
    6
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    6
    return true;
    else
            
                                            
    7
    ++valueListIndex;
    Preondition Violations
    Unmatched statement ++valueListIndex; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    ++valueListIndex;
    7
    --valueListIndex;
    7
    --valueListIndex;
    Preondition Violations
    Unmatched statement --valueListIndex; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                            
    Precondition Violations (4)
    Row Violation
    1Unmatched statement ++valueListIndex; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement --valueListIndex; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Conditional return true;
    4Conditional return true;