if (validator.isValid(otherEntry.getEStructuralFeature())) { if (otherEntry.equals(entry)) { return false; } else { doSet(i, object); return true; } }
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: 5 Number of AST nodes: 5
1
if (validator.isValid(otherEntry.getEStructuralFeature()))
1
if (validator.isValid(otherEntry.getEStructuralFeature()))
2
        {
2
        {
3
          if (otherEntry.equals(entry))
3
          if (otherEntry.equals(object))
4
          {
4
          {
5
            return false;
5
            return false;
6
          }
6
          }
7
          else
7
          else
8
          {
8
          {
9
            doSet(i, object);
9
            doSet(i, object);
10
            return true;
10
            return true;
11
          }
11
          }
12
        }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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;