Object notificationNotifier = notification.getNotifier(); if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null)) { eventType = Notification.REMOVE_MANY; BasicEList<Object> removedValues = new BasicEList<Object>(2); removedValues.add(oldValue); removedValues.add(notification.getOldValue()); oldValue = removedValues; int [] positions = new int [] { position, notification.getPosition() }; newValue = positions; return true; } break;
Object notificationNotifier = notification.getNotifier(); if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null)) { eventType = Notification.ADD_MANY; BasicEList<Object> addedValues = new BasicEList<Object>(2); addedValues.add(newValue); addedValues.add(notification.getNewValue()); newValue = addedValues; return true; } break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/FeatureMapUtil.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/FeatureMapUtil.java
Method name: boolean merge(Notification) Method name: boolean merge(Notification)
Number of AST nodes: 11 Number of AST nodes: 9
1
Object notificationNotifier = notification.getNotifier();
1
Object notificationNotifier = notification.getNotifier();
2
              if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null))
2
              if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null))
3
              {
3
              {
4
                eventType = Notification.REMOVE_MANY;
4
                eventType = Notification.ADD_MANY;
5
                BasicEList<Object> removedValues = new BasicEList<Object>(2);
5
                BasicEList<Object> addedValues = new BasicEList<Object>(2);
6
                removedValues.add(oldValue);
6
                addedValues.add(newValue);
7
                removedValues.add(notification.getOldValue());
7
                addedValues.add(notification.getNewValue());
8
                oldValue = removedValues;
8
                
9
                int [] positions = new int [] { position, notification.getPosition() };
10
                newValue = positions;
9
newValue = addedValues;
11
                return true;
10
                return true;
12
              }
11
              }
13
              break;
12
              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.3
Clones locationClones are in the same method
Number of node comparisons68
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    47
    Object notificationNotifier = notification.getNotifier();
    15
    Object notificationNotifier = notification.getNotifier();
    48
    if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null))
    16
    if (notificationNotifier == getNotifier() && getFeatureID(null) == notification.getFeatureID(null))
    49
    eventType = Notification.REMOVE_MANY;
    49
    eventType = Notification.REMOVE_MANY;
    17
    eventType = Notification.ADD_MANY;
    Differences
    Expression1Expression2Difference
    REMOVE_MANYADD_MANYVARIABLE_NAME_MISMATCH
    17
    eventType = Notification.ADD_MANY;
    50
    BasicEList<Object> removedValues = new BasicEList<Object>(2);
    50
    BasicEList<Object> removedValues = new BasicEList<Object>(2);
    18
    BasicEList<Object> addedValues = new BasicEList<Object>(2);
    Differences
    Expression1Expression2Difference
    removedValuesaddedValuesVARIABLE_NAME_MISMATCH
    18
    BasicEList<Object> addedValues = new BasicEList<Object>(2);
    51
    removedValues.add(oldValue);
    51
    removedValues.add(oldValue);
    19
    addedValues.add(newValue);
    Differences
    Expression1Expression2Difference
    oldValuenewValueVARIABLE_NAME_MISMATCH
    removedValuesaddedValuesVARIABLE_NAME_MISMATCH
    19
    addedValues.add(newValue);
    52
    removedValues.add(notification.getOldValue());
    52
    removedValues.add(notification.getOldValue());
    20
    addedValues.add(notification.getNewValue());
    Differences
    Expression1Expression2Difference
    getOldValuegetNewValueMETHOD_INVOCATION_NAME_MISMATCH
    removedValuesaddedValuesVARIABLE_NAME_MISMATCH
    20
    addedValues.add(notification.getNewValue());
    53
    oldValue = removedValues;
    53
    oldValue = removedValues;
    21
    newValue = addedValues;
    Differences
    Expression1Expression2Difference
    oldValuenewValueVARIABLE_NAME_MISMATCH
    removedValuesaddedValuesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression oldValue is a field being modified, and thus it cannot be parameterized
    Expression newValue is a field being modified, and thus it cannot be parameterized
    21
    newValue = addedValues;
    54
    int[] positions = new int[] {position, notification.getPosition()};
                                                                                                                                          
    55
    newValue = positions;
                                                  
    56
    return true;
    56
    return true;
    22
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    22
    return true;
    57
    break;
    23
    break;
    Precondition Violations (4)
    Row Violation
    1Expression oldValue is a field being modified, and thus it cannot be parameterized
    2Expression newValue is a field being modified, and thus it cannot be parameterized
    3Conditional return true;
    4Conditional return true;