File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/DelegatingNotifyingListImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java | |||
Method name: boolean addAllUnique(int, Collection extends E>)
|
Method name: boolean addAllUnique(int, Collection extends E>)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | boolean oldIsSet = isSet();↵ | 1 | boolean oldIsSet = isSet();↵ | |
2 | doAddAllUnique(index, collection);↵ | 2 | doAddAllUnique(index, collection);↵ | |
3 | NotificationImpl notification =↵ | 3 | NotificationImpl notification =↵ | |
4 | collectionSize == 1 ?↵ | 4 | collectionSize == 1 ?↵ | |
5 | createNotification(Notification.ADD, null, collection.iterator().next(), index, oldIsSet) :↵ | 5 | createNotification(Notification.ADD, null, collection.iterator().next(), index, oldIsSet) :↵ | |
6 | createNotification(Notification.ADD_MANY, null, collection, index, oldIsSet);↵ | 6 | createNotification(Notification.ADD_MANY, null, collection, index, oldIsSet);↵ | |
7 | if (hasInverse())↵ | 7 | if (hasInverse())↵ | |
8 | {↵ | 8 | {↵ | |
9 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | 9 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | |
10 | int lastIndex = index + collectionSize;↵ | 10 | int lastIndex = index + collectionSize;↵ | |
11 | for (int i = index; i < lastIndex; ++i)↵ | 11 | for (int i = index; i < lastIndex; ++i)↵ | |
12 | { ↵ | 12 | { ↵ | |
13 | E value = delegateGet(i);↵ | 13 | @SuppressWarnings("unchecked") E value = (E)data[i];↵ | |
14 | notifications = inverseAdd(value, notifications);↵ | 14 | notifications = inverseAdd(value, notifications);↵ | |
15 | notifications = shadowAdd(value, notifications);↵ | 15 | notifications = shadowAdd(value, notifications);↵ | |
16 | }↵ | 16 | }↵ | |
17 | if (notifications == null)↵ | 17 | if (notifications == null)↵ | |
18 | {↵ | 18 | {↵ | |
19 | dispatchNotification(notification);↵ | 19 | dispatchNotification(notification);↵ | |
20 | }↵ | 20 | }↵ | |
21 | else↵ | 21 | else↵ | |
22 | {↵ | 22 | {↵ | |
23 | notifications.add(notification);↵ | 23 | notifications.add(notification);↵ | |
24 | notifications.dispatch();↵ | 24 | notifications.dispatch();↵ | |
25 | }↵ | 25 | }↵ | |
26 | }↵ | 26 | }↵ | |
27 | else↵ | 27 | else↵ | |
28 | {↵ | 28 | {↵ | |
29 | dispatchNotification(notification);↵ | 29 | dispatchNotification(notification);↵ | |
30 | } | 30 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 75 |
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 3561.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | boolean oldIsSet = isSet(); | 5 | boolean oldIsSet = isSet(); | ||||||||||||||||||||
6 | doAddAllUnique(index, collection); |
| 6 | doAddAllUnique(index, collection); | |||||||||||||||||||
7 | NotificationImpl notification = collectionSize == 1 ? createNotification(Notification.ADD, null, collection.iterator().next(), index, oldIsSet) : createNotification(Notification.ADD_MANY, null, collection, index, oldIsSet); |
| 7 | NotificationImpl notification = collectionSize == 1 ? createNotification(Notification.ADD, null, collection.iterator().next(), index, oldIsSet) : createNotification(Notification.ADD_MANY, null, collection, index, oldIsSet); | |||||||||||||||||||
8 | if (hasInverse()) | 8 | if (hasInverse()) | ||||||||||||||||||||
9 | NotificationChain notifications = createNotificationChain(collectionSize); | 9 | NotificationChain notifications = createNotificationChain(collectionSize); | ||||||||||||||||||||
10 | int lastIndex = index + collectionSize; | 10 | int lastIndex = index + collectionSize; | ||||||||||||||||||||
11 | for (int i = index; i < lastIndex; ++i) | 11 | for (int i = index; i < lastIndex; ++i) | ||||||||||||||||||||
|
| 12 | @SuppressWarnings("unchecked") E value = (E)data[i]; | ||||||||||||||||||||
12 | E value = delegateGet(i); |
| | ||||||||||||||||||||
13 | notifications = inverseAdd(value, notifications); | 13 | notifications = inverseAdd(value, notifications); | ||||||||||||||||||||
14 | notifications = shadowAdd(value, notifications); | 14 | notifications = shadowAdd(value, notifications); | ||||||||||||||||||||
15 | if (notifications == null) | 15 | if (notifications == null) | ||||||||||||||||||||
16 | dispatchNotification(notification); | 16 | dispatchNotification(notification); | ||||||||||||||||||||
else | else | ||||||||||||||||||||||
17 | notifications.add(notification); | 17 | notifications.add(notification); | ||||||||||||||||||||
18 | notifications.dispatch(); | 18 | notifications.dispatch(); | ||||||||||||||||||||
else | else | ||||||||||||||||||||||
19 | dispatchNotification(notification); | 19 | dispatchNotification(notification); |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Type java.util.Iterator<> of variable collection.iterator() does not match with type java.util.Iterator<> of variable collection.iterator() |
3 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
4 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
5 | Unmatched statement @SuppressWarnings("unchecked") E value=(E)data[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement E value=delegateGet(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |