Notifier newValue = (Notifier)notification.getNewValue(); if (newValue != null) { addAdapter(newValue); } break;
Notifier oldValue = (Notifier)notification.getOldValue(); if (oldValue != null) { removeAdapter(oldValue); } break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentAdapter.java
Method name: void handleContainment(Notification) Method name: void handleContainment(Notification)
Number of AST nodes: 4 Number of AST nodes: 4
1
Notifier newValue = (Notifier)notification.getNewValue();
1
Notifier oldValue = (Notifier)notification.getOldValue();
2
        if (newValue != null)
2
        if (oldValue != null)
3
        {
3
        {
4
          addAdapter(newValue);
4
          removeAdapter(oldValue);
5
        }
5
        }
6
        break;
6
        break;
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.1
Clones locationClones are in the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    Notifier newValue = (Notifier)notification.getNewValue();
    27
    Notifier newValue = (Notifier)notification.getNewValue();
    37
    Notifier oldValue = (Notifier)notification.getOldValue();
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    getNewValuegetOldValueMETHOD_INVOCATION_NAME_MISMATCH
    37
    Notifier oldValue = (Notifier)notification.getOldValue();
    28
    if (newValue != null)
    28
    if (newValue != null)
    38
    if (oldValue != null)
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    38
    if (oldValue != null)
    29
    addAdapter(newValue);
    29
    addAdapter(newValue);
    39
    removeAdapter(oldValue);
    Differences
    Expression1Expression2Difference
    addAdapterremoveAdapterMETHOD_INVOCATION_NAME_MISMATCH
    newValueoldValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression addAdapter(newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeAdapter(oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    Expression removeAdapter(oldValue) is a void method call, and thus it cannot be parameterized
    39
    removeAdapter(oldValue);
    30
    break;
    40
    break;
    Precondition Violations (4)
    Row Violation
    1Expression addAdapter(newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression removeAdapter(oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    4Expression removeAdapter(oldValue) is a void method call, and thus it cannot be parameterized