@SuppressWarnings("unchecked") Collection<Notifier> newValues = (Collection<Notifier>)notification.getNewValue(); for (Notifier newValue : newValues) { addAdapter(newValue); } break;
@SuppressWarnings("unchecked") Collection<Notifier> oldValues = (Collection<Notifier>)notification.getOldValue(); for ( Notifier oldContentValue : oldValues) { removeAdapter(oldContentValue); } 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
@SuppressWarnings("unchecked") Collection<Notifier> newValues = (Collection<Notifier>)notification.getNewValue();
1
@SuppressWarnings("unchecked") Collection<Notifier> oldValues = (Collection<Notifier>)notification.getOldValue();
2
        for (Notifier newValue : newValues)
2
        for ( Notifier oldContentValue : oldValues)
3
        {
3
        {
4
          addAdapter(newValue);
4
          removeAdapter(oldContentValue);
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    32
    @SuppressWarnings("unchecked") Collection<Notifier> newValues = (Collection<Notifier>)notification.getNewValue();
    32
    @SuppressWarnings("unchecked") Collection<Notifier> newValues = (Collection<Notifier>)notification.getNewValue();
    42
    @SuppressWarnings("unchecked") Collection<Notifier> oldValues = (Collection<Notifier>)notification.getOldValue();
    Differences
    Expression1Expression2Difference
    newValuesoldValuesVARIABLE_NAME_MISMATCH
    getNewValuegetOldValueMETHOD_INVOCATION_NAME_MISMATCH
    42
    @SuppressWarnings("unchecked") Collection<Notifier> oldValues = (Collection<Notifier>)notification.getOldValue();
    33
    for (Notifier newValue : newValues)
    33
    for (Notifier newValue : newValues)
    43
    for (Notifier oldContentValue : oldValues)
    Differences
    Expression1Expression2Difference
    newValueoldContentValueVARIABLE_NAME_MISMATCH
    newValuesoldValuesVARIABLE_NAME_MISMATCH
    43
    for (Notifier oldContentValue : oldValues)
    34
    addAdapter(newValue);
    34
    addAdapter(newValue);
    44
    removeAdapter(oldContentValue);
    Differences
    Expression1Expression2Difference
    addAdapterremoveAdapterMETHOD_INVOCATION_NAME_MISMATCH
    newValueoldContentValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression addAdapter(newValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeAdapter(oldContentValue) 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(oldContentValue) is a void method call, and thus it cannot be parameterized
    44
    removeAdapter(oldContentValue);
    35
    break;
    45
    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(oldContentValue) 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(oldContentValue) is a void method call, and thus it cannot be parameterized