if (newValue == null) { switch (primitiveType) { case PRIMITIVE_TYPE_BOOLEAN: newValue = getNewBooleanValue() ? Boolean.TRUE : Boolean.FALSE; break; case PRIMITIVE_TYPE_BYTE: newValue = getNewByteValue(); break; case PRIMITIVE_TYPE_CHAR: newValue = getNewCharValue(); break; case PRIMITIVE_TYPE_DOUBLE: newValue = getNewDoubleValue(); break; case PRIMITIVE_TYPE_FLOAT: newValue = getNewFloatValue(); break; case PRIMITIVE_TYPE_LONG: newValue = getNewLongValue(); break; case PRIMITIVE_TYPE_INT: newValue = getNewIntValue(); break; case PRIMITIVE_TYPE_SHORT: newValue = getNewShortValue(); break; } } return newValue;
if (oldValue == null) { switch (primitiveType) { case PRIMITIVE_TYPE_BOOLEAN: oldValue = getOldBooleanValue() ? Boolean.TRUE : Boolean.FALSE; break; case PRIMITIVE_TYPE_BYTE: oldValue = getOldByteValue(); break; case PRIMITIVE_TYPE_CHAR: oldValue = getOldCharValue(); break; case PRIMITIVE_TYPE_DOUBLE: oldValue = getOldDoubleValue(); break; case PRIMITIVE_TYPE_FLOAT: oldValue = getOldFloatValue(); break; case PRIMITIVE_TYPE_LONG: oldValue = getOldLongValue(); break; case PRIMITIVE_TYPE_INT: oldValue = getOldIntValue(); break; case PRIMITIVE_TYPE_SHORT: oldValue = getOldShortValue(); break; } } return oldValue;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java
Method name: Object getNewValue() Method name: Object getOldValue()
Number of AST nodes: 27 Number of AST nodes: 27
1
if (newValue == null)
1
if (oldValue == null)
2
    {
2
    {
3
      switch (primitiveType)
3
      switch (primitiveType)
4
      {
4
      {
5
        case PRIMITIVE_TYPE_BOOLEAN:
5
        case PRIMITIVE_TYPE_BOOLEAN:
6
          newValue = getNewBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
6
          oldValue = getOldBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
7
          break;
7
          break;
8
        case PRIMITIVE_TYPE_BYTE:
8
        case PRIMITIVE_TYPE_BYTE:
9
          newValue = getNewByteValue();
9
          oldValue = getOldByteValue();
10
          break;
10
          break;
11
        case PRIMITIVE_TYPE_CHAR:
11
        case PRIMITIVE_TYPE_CHAR:
12
          newValue = getNewCharValue();
12
          oldValue = getOldCharValue();
13
          break;
13
          break;
14
        case PRIMITIVE_TYPE_DOUBLE:
14
        case PRIMITIVE_TYPE_DOUBLE:
15
          newValue = getNewDoubleValue();
15
          oldValue = getOldDoubleValue();
16
          break;
16
          break;
17
        case PRIMITIVE_TYPE_FLOAT:
17
        case PRIMITIVE_TYPE_FLOAT:
18
          newValue = getNewFloatValue();
18
          oldValue = getOldFloatValue();
19
          break;
19
          break;
20
        case PRIMITIVE_TYPE_LONG:
20
        case PRIMITIVE_TYPE_LONG:
21
          newValue = getNewLongValue();
21
          oldValue = getOldLongValue();
22
          break;
22
          break;
23
        case PRIMITIVE_TYPE_INT:
23
        case PRIMITIVE_TYPE_INT:
24
          newValue = getNewIntValue();
24
          oldValue = getOldIntValue();
25
          break;
25
          break;
26
        case PRIMITIVE_TYPE_SHORT:
26
        case PRIMITIVE_TYPE_SHORT:
27
          newValue = getNewShortValue();
27
          oldValue = getOldShortValue();
28
          break;
28
          break;
29
      }
29
      }
30
    }
30
    }
31
    return newValue;
31
    return oldValue;
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.2
Clones locationClones are declared in the same class
Number of node comparisons327
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements27
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (newValue == null)
    1
    if (newValue == null)
    1
    if (oldValue == null)
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    1
    if (oldValue == null)
    2
    switch (primitiveType)
    2
    switch (primitiveType)
    3
    case PRIMITIVE_TYPE_BOOLEAN:
    3
    case PRIMITIVE_TYPE_BOOLEAN:
    4
    newValue = getNewBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
    4
    newValue = getNewBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
    4
    oldValue = getOldBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewBooleanValuegetOldBooleanValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    4
    oldValue = getOldBooleanValue() ? Boolean.TRUE : Boolean.FALSE;
    5
    break;
    5
    break;
    6
    case PRIMITIVE_TYPE_BYTE:
    6
    case PRIMITIVE_TYPE_BYTE:
    7
    newValue = getNewByteValue();
    7
    newValue = getNewByteValue();
    7
    oldValue = getOldByteValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewByteValuegetOldByteValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    7
    oldValue = getOldByteValue();
    8
    break;
    8
    break;
    9
    case PRIMITIVE_TYPE_CHAR:
    9
    case PRIMITIVE_TYPE_CHAR:
    10
    newValue = getNewCharValue();
    10
    newValue = getNewCharValue();
    10
    oldValue = getOldCharValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewCharValuegetOldCharValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    10
    oldValue = getOldCharValue();
    11
    break;
    11
    break;
    12
    case PRIMITIVE_TYPE_DOUBLE:
    12
    case PRIMITIVE_TYPE_DOUBLE:
    13
    newValue = getNewDoubleValue();
    13
    newValue = getNewDoubleValue();
    13
    oldValue = getOldDoubleValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewDoubleValuegetOldDoubleValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    13
    oldValue = getOldDoubleValue();
    14
    break;
    14
    break;
    15
    case PRIMITIVE_TYPE_FLOAT:
    15
    case PRIMITIVE_TYPE_FLOAT:
    16
    newValue = getNewFloatValue();
    16
    newValue = getNewFloatValue();
    16
    oldValue = getOldFloatValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewFloatValuegetOldFloatValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    16
    oldValue = getOldFloatValue();
    17
    break;
    17
    break;
    18
    case PRIMITIVE_TYPE_LONG:
    18
    case PRIMITIVE_TYPE_LONG:
    19
    newValue = getNewLongValue();
    19
    newValue = getNewLongValue();
    19
    oldValue = getOldLongValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewLongValuegetOldLongValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    19
    oldValue = getOldLongValue();
    20
    break;
    20
    break;
    21
    case PRIMITIVE_TYPE_INT:
    21
    case PRIMITIVE_TYPE_INT:
    22
    newValue = getNewIntValue();
    22
    newValue = getNewIntValue();
    22
    oldValue = getOldIntValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewIntValuegetOldIntValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    22
    oldValue = getOldIntValue();
    23
    break;
    23
    break;
    24
    case PRIMITIVE_TYPE_SHORT:
    24
    case PRIMITIVE_TYPE_SHORT:
    25
    newValue = getNewShortValue();
    25
    newValue = getNewShortValue();
    25
    oldValue = getOldShortValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewShortValuegetOldShortValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression newValue is a field being modified, and thus it cannot be parameterized
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    25
    oldValue = getOldShortValue();
    26
    break;
    26
    break;
    27
    return newValue;
    27
    return newValue;
    27
    return oldValue;
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression newValue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression oldValue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27
    return oldValue;
    Precondition Violations (18)
    Row Violation
    1Expression newValue is a field being modified, and thus it cannot be parameterized
    2Expression oldValue is a field being modified, and thus it cannot be parameterized
    3Expression newValue is a field being modified, and thus it cannot be parameterized
    4Expression oldValue is a field being modified, and thus it cannot be parameterized
    5Expression newValue is a field being modified, and thus it cannot be parameterized
    6Expression oldValue is a field being modified, and thus it cannot be parameterized
    7Expression newValue is a field being modified, and thus it cannot be parameterized
    8Expression oldValue is a field being modified, and thus it cannot be parameterized
    9Expression newValue is a field being modified, and thus it cannot be parameterized
    10Expression oldValue is a field being modified, and thus it cannot be parameterized
    11Expression newValue is a field being modified, and thus it cannot be parameterized
    12Expression oldValue is a field being modified, and thus it cannot be parameterized
    13Expression newValue is a field being modified, and thus it cannot be parameterized
    14Expression oldValue is a field being modified, and thus it cannot be parameterized
    15Expression newValue is a field being modified, and thus it cannot be parameterized
    16Expression oldValue is a field being modified, and thus it cannot be parameterized
    17Expression newValue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression oldValue cannot be parameterized, because it has dependencies to/from statements that will be extracted