Entry otherEntry = entries[i]; if (validator.isValid(otherEntry.getEStructuralFeature())) { if (otherEntry.equals(entry)) { return false; } else { doSet(i, object); return true; } }
Entry otherEntry = delegateGet(i); if (validator.isValid(otherEntry.getEStructuralFeature())) { if (otherEntry.equals(object)) { return false; } else { doSet(i, object); return true; } }
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: boolean add(Entry) Method name: boolean add(Entry)
Number of AST nodes: 6 Number of AST nodes: 6
1
Entry otherEntry = entries[i];
1
Entry otherEntry = delegateGet(i);
2
        if (validator.isValid(otherEntry.getEStructuralFeature()))
2
        if (validator.isValid(otherEntry.getEStructuralFeature()))
3
        {
3
        {
4
          if (otherEntry.equals(entry))
4
          if (otherEntry.equals(object))
5
          {
5
          {
6
            return false;
6
            return false;
7
          }
7
          }
8
          else
8
          else
9
          {
9
          {
10
            doSet(i, object);
10
            doSet(i, object);
11
            return true;
11
            return true;
12
          }
12
          }
13
        }
13
        }
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 comparisons19
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    Entry otherEntry = entries[i];
    9
    Entry otherEntry = entries[i];
    7
    Entry otherEntry = delegateGet(i);
    Differences
    Expression1Expression2Difference
    entries[i]delegateGet(i)TYPE_COMPATIBLE_REPLACEMENT
    7
    Entry otherEntry = delegateGet(i);
    10
    if (validator.isValid(otherEntry.getEStructuralFeature()))
    8
    if (validator.isValid(otherEntry.getEStructuralFeature()))
    11
    if (otherEntry.equals(entry))
    11
    if (otherEntry.equals(entry))
    9
    if (otherEntry.equals(object))
    Differences
    Expression1Expression2Difference
    entryobjectVARIABLE_NAME_MISMATCH
    9
    if (otherEntry.equals(object))
    12
    return false;
    12
    return false;
    10
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    10
    return false;
    else
    else
    13
    doSet(i, object);
    11
    doSet(i, object);
    14
    return true;
    14
    return true;
    12
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    12
    return true;
    Precondition Violations (4)
    Row Violation
    1Conditional return true;
    2Conditional return true;
    3Conditional return false;
    4Conditional return false;