Notifier oldValue = (Notifier)notification.getOldValue(); if (oldValue != null) { removeAdapter(oldValue); } break;
Notifier newValue = (Notifier)notification.getNewValue(); if (newValue != null) { addAdapter(newValue); } 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/ECrossReferenceAdapter.java
Method name: void handleContainment(Notification) Method name: void handleContainment(Notification)
Number of AST nodes: 4 Number of AST nodes: 4
1
Notifier oldValue = (Notifier)notification.getOldValue();
1
Notifier newValue = (Notifier)notification.getNewValue();
2
        if (oldValue != null)
2
        if (newValue != null)
3
        {
3
        {
4
          removeAdapter(oldValue);
4
          addAdapter(newValue);
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 different classes
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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    37
    Notifier oldValue = (Notifier)notification.getOldValue();
    37
    Notifier oldValue = (Notifier)notification.getOldValue();
    14
    Notifier newValue = (Notifier)notification.getNewValue();
    Differences
    Expression1Expression2Difference
    oldValuenewValueVARIABLE_NAME_MISMATCH
    getOldValuegetNewValueMETHOD_INVOCATION_NAME_MISMATCH
    14
    Notifier newValue = (Notifier)notification.getNewValue();
    38
    if (oldValue != null)
    38
    if (oldValue != null)
    15
    if (newValue != null)
    Differences
    Expression1Expression2Difference
    oldValuenewValueVARIABLE_NAME_MISMATCH
    15
    if (newValue != null)
    39
    removeAdapter(oldValue);
    39
    removeAdapter(oldValue);
    16
    addAdapter(newValue);
    Differences
    Expression1Expression2Difference
    removeAdapteraddAdapterMETHOD_INVOCATION_NAME_MISMATCH
    oldValuenewValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression removeAdapter(oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addAdapter(newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeAdapter(oldValue) is a void method call, and thus it cannot be parameterized
    Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    16
    addAdapter(newValue);
    40
    break;
    17
    break;
    Precondition Violations (4)
    Row Violation
    1Expression removeAdapter(oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression addAdapter(newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression removeAdapter(oldValue) is a void method call, and thus it cannot be parameterized
    4Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized