boolean oldIsSet = true; Object oldValue = settings.dynamicGet(index); if (oldValue == null) { oldIsSet = false; oldValue = this.defaultValue; } else if (oldValue == NIL) { oldValue = null; }
boolean oldIsSet = true; Object oldValue = settings.dynamicGet(index); if (oldValue == null) { oldIsSet = false; oldValue = this.defaultValue; } else if (oldValue == NIL) { oldValue = null; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java
Method name: void dynamicSet(InternalEObject, EStructuralFeature.Internal.DynamicValueHolder, int, Object) Method name: void dynamicUnset(InternalEObject, EStructuralFeature.Internal.DynamicValueHolder, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
boolean oldIsSet = true;
1
boolean oldIsSet = true;
2
        Object oldValue = settings.dynamicGet(index);
2
        Object oldValue = settings.dynamicGet(index);
3
        if (oldValue == null)
3
        if (oldValue == null)
4
        {
4
        {
5
          oldIsSet = false;
5
          oldIsSet = false;
6
          oldValue = this.defaultValue;
6
          oldValue = this.defaultValue;
7
        }
7
        }
8
        else if (oldValue == NIL)
8
        else if (oldValue == NIL)
9
        {
9
        {
10
          oldValue = null;
10
          oldValue = null;
11
        }
11
        }
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 declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    2
    boolean oldIsSet = true;
    2
    boolean oldIsSet = true;
    3
    Object oldValue = settings.dynamicGet(index);
    3
    Object oldValue = settings.dynamicGet(index);
    4
    if (oldValue == null)
    4
    if (oldValue == null)
    5
    oldIsSet = false;
    5
    oldIsSet = false;
    6
    oldValue = this.defaultValue;
    6
    oldValue = this.defaultValue;
    7
    else if (oldValue == NIL)
    7
    else if (oldValue == NIL)
    8
    oldValue = null;
    8
    oldValue = null;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables oldIsSet, oldValue , while Clone fragment #2 returns variables oldIsSet, oldValue