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 removeAll(Collection>)
|
Method name: boolean removeAll(Collection>)
|
|||
Number of AST nodes: 26 | Number of AST nodes: 26 | |||
1 | if (result)↵ | 1 | if (result)↵ | |
2 | {↵ | 2 | {↵ | |
3 | if (positions != null)↵ | 3 | if (positions != null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | int collectionSize = collection.size();↵ | 5 | int collectionSize = collection.size();↵ | |
6 | NotificationImpl notification =↵ | 6 | NotificationImpl notification =↵ | |
7 | (collectionSize == 1 ?↵ | 7 | (collectionSize == 1 ?↵ | |
8 | createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) :↵ | 8 | createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) :↵ | |
9 | createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet));↵ | 9 | createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet));↵ | |
10 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | 10 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | |
11 | if (hasInverse())↵ | 11 | if (hasInverse())↵ | |
12 | {↵ | 12 | {↵ | |
13 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | 13 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | |
14 | {↵ | 14 | {↵ | |
15 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | 15 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | |
16 | notifications = inverseRemove(object, notifications);↵ | 16 | notifications = inverseRemove(object, notifications);↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (notifications == null)↵ | 18 | if (notifications == null)↵ | |
19 | {↵ | 19 | {↵ | |
20 | dispatchNotification(notification);↵ | 20 | dispatchNotification(notification);↵ | |
21 | }↵ | 21 | }↵ | |
22 | else↵ | 22 | else↵ | |
23 | {↵ | 23 | {↵ | |
24 | notifications.add(notification);↵ | 24 | notifications.add(notification);↵ | |
25 | notifications.dispatch();↵ | 25 | notifications.dispatch();↵ | |
26 | }↵ | 26 | }↵ | |
27 | }↵ | 27 | }↵ | |
28 | else↵ | 28 | else↵ | |
29 | {↵ | 29 | {↵ | |
30 | if (notifications == null)↵ | 30 | if (notifications == null)↵ | |
31 | {↵ | 31 | {↵ | |
32 | dispatchNotification(notification);↵ | 32 | dispatchNotification(notification);↵ | |
33 | }↵ | 33 | }↵ | |
34 | else↵ | 34 | else↵ | |
35 | {↵ | 35 | {↵ | |
36 | notifications.add(notification);↵ | 36 | notifications.add(notification);↵ | |
37 | notifications.dispatch();↵ | 37 | notifications.dispatch();↵ | |
38 | }↵ | 38 | }↵ | |
39 | }↵ | 39 | }↵ | |
40 | }↵ | 40 | }↵ | |
41 | else if (hasInverse())↵ | 41 | else if (hasInverse())↵ | |
42 | {↵ | 42 | {↵ | |
43 | NotificationChain notifications = createNotificationChain(collection.size());↵ | 43 | NotificationChain notifications = createNotificationChain(collection.size());↵ | |
44 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | 44 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | |
45 | {↵ | 45 | {↵ | |
46 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | 46 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | |
47 | notifications = inverseRemove(object, notifications);↵ | 47 | notifications = inverseRemove(object, notifications);↵ | |
48 | }↵ | 48 | }↵ | |
49 | if (notifications != null) notifications.dispatch();↵ | 49 | if (notifications != null) notifications.dispatch();↵ | |
50 | }↵ | 50 | }↵ | |
51 | return true;↵ | 51 | return true;↵ | |
52 | }↵ | 52 | }↵ | |
53 | else↵ | 53 | else↵ | |
54 | {↵ | 54 | {↵ | |
55 | return false;↵ | 55 | return false;↵ | |
56 | } | 56 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 2 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 2.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 109 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 7191.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74 | int collectionSize = collection.size(); |
| 74 | int collectionSize = collection.size(); | |||||||||||||||||||||||
75 | NotificationImpl notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet)); |
| 75 | NotificationImpl notification = (collectionSize == 1 ? createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) : createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet)); | |||||||||||||||||||||||
76 | NotificationChain notifications = createNotificationChain(collectionSize); | 76 | NotificationChain notifications = createNotificationChain(collectionSize); | ||||||||||||||||||||||||
77 | if (hasInverse()) | 77 | if (hasInverse()) | ||||||||||||||||||||||||
|
| 78 | for (Iterator<?> i = collection.iterator(); i.hasNext(); ) | ||||||||||||||||||||||||
| 79 | @SuppressWarnings("unchecked") E object = (E)i.next(); | |||||||||||||||||||||||||
|
| 80 | notifications = inverseRemove(object, notifications); | ||||||||||||||||||||||||
78 | for (Iterator<?> i = collection.iterator(); i.hasNext(); ) |
| | ||||||||||||||||||||||||
79 | @SuppressWarnings("unchecked") E object = (E)i.next(); | | |||||||||||||||||||||||||
80 | notifications = inverseRemove(object, notifications); |
| | ||||||||||||||||||||||||
81 | if (notifications == null) | 81 | if (notifications == null) | ||||||||||||||||||||||||
82 | dispatchNotification(notification); | 82 | dispatchNotification(notification); | ||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
83 | notifications.add(notification); | 83 | notifications.add(notification); | ||||||||||||||||||||||||
84 | notifications.dispatch(); | 84 | notifications.dispatch(); | ||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
85 | if (notifications == null) | 85 | if (notifications == null) | ||||||||||||||||||||||||
86 | dispatchNotification(notification); | 86 | dispatchNotification(notification); | ||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
87 | notifications.add(notification); | 87 | notifications.add(notification); | ||||||||||||||||||||||||
88 | notifications.dispatch(); | 88 | notifications.dispatch(); |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Type of variable collection.iterator().next() does not match with type of variable collection.iterator().next() |
3 | Type java.util.Iterator<> of variable collection.iterator() does not match with type java.util.Iterator<> of variable collection.iterator() |
4 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
5 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
6 | Unmatched statement for(Iterator<?> i=collection.iterator(); i.hasNext()) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement notifications=inverseRemove(object,notifications); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement for(Iterator<?> i=collection.iterator(); i.hasNext()) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement notifications=inverseRemove(object,notifications); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
90 | NotificationChain notifications = createNotificationChain(collection.size()); |
| 90 | NotificationChain notifications = createNotificationChain(collection.size()); | |||||||||||
| 91 | for (Iterator<?> i = collection.iterator(); i.hasNext(); ) | |||||||||||||
| 92 | @SuppressWarnings("unchecked") E object = (E)i.next(); | |||||||||||||
|
| 93 | notifications = inverseRemove(object, notifications); | ||||||||||||
91 | for (Iterator<?> i = collection.iterator(); i.hasNext(); ) | | |||||||||||||
92 | @SuppressWarnings("unchecked") E object = (E)i.next(); | | |||||||||||||
93 | notifications = inverseRemove(object, notifications); |
| | ||||||||||||
94 | if (notifications != null) | 94 | if (notifications != null) | ||||||||||||
95 | notifications.dispatch(); | 95 | notifications.dispatch(); |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Unmatched statement notifications=inverseRemove(object,notifications); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement notifications=inverseRemove(object,notifications); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |