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 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 68 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.1 |
Clone type | Type 3 |
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; |
| 17 | eventType = Notification.ADD_MANY; | |||||||||||||||
50 | BasicEList<Object> removedValues = new BasicEList<Object>(2); |
| 18 | BasicEList<Object> addedValues = new BasicEList<Object>(2); | |||||||||||||||
51 | removedValues.add(oldValue); |
| 19 | addedValues.add(newValue); | |||||||||||||||
52 | removedValues.add(notification.getOldValue()); |
| 20 | addedValues.add(notification.getNewValue()); | |||||||||||||||
53 | oldValue = removedValues; |
| 21 | newValue = addedValues; | |||||||||||||||
54 | int[] positions = new int[] {position, notification.getPosition()}; | | |||||||||||||||||
55 | newValue = positions; | | |||||||||||||||||
56 | return true; |
| 22 | return true; | |||||||||||||||
57 | break; | 23 | break; |
Row | Violation |
---|---|
1 | Expression oldValue is a field being modified, and thus it cannot be parameterized |
2 | Expression newValue is a field being modified, and thus it cannot be parameterized |
3 | Conditional return true; |
4 | Conditional return true; |