File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/DelegatingNotifyingListImpl.java | |||
Method name: boolean removeAll(Collection>)
|
Method name: boolean removeAll(Collection>)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | if (positions != null)↵ | 1 | if (positions != null)↵ | |
2 | {↵ | 2 | {↵ | |
3 | int collectionSize = collection.size();↵ | 3 | int collectionSize = collection.size();↵ | |
4 | NotificationImpl notification =↵ | 4 | NotificationImpl notification =↵ | |
5 | (collectionSize == 1 ?↵ | 5 | (collectionSize == 1 ?↵ | |
6 | createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) :↵ | 6 | createNotification(Notification.REMOVE, collection.iterator().next(), null, positions[0], oldIsSet) :↵ | |
7 | createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet));↵ | 7 | createNotification(Notification.REMOVE_MANY, collection, positions, positions[0], oldIsSet));↵ | |
8 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | 8 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | |
9 | if (hasInverse())↵ | 9 | if (hasInverse())↵ | |
10 | {↵ | 10 | {↵ | |
11 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | 11 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | |
12 | {↵ | 12 | {↵ | |
13 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | 13 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | |
14 | notifications = inverseRemove(object, notifications);↵ | 14 | notifications = inverseRemove(object, notifications);↵ | |
15 | }↵ | 15 | }↵ | |
16 | if (notifications == null)↵ | 16 | if (notifications == null)↵ | |
17 | {↵ | 17 | {↵ | |
18 | dispatchNotification(notification);↵ | 18 | dispatchNotification(notification);↵ | |
19 | }↵ | 19 | }↵ | |
20 | else↵ | 20 | else↵ | |
21 | {↵ | 21 | {↵ | |
22 | notifications.add(notification);↵ | 22 | notifications.add(notification);↵ | |
23 | notifications.dispatch();↵ | 23 | notifications.dispatch();↵ | |
24 | }↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | else↵ | 26 | else↵ | |
27 | {↵ | 27 | {↵ | |
28 | if (notifications == null)↵ | 28 | if (notifications == null)↵ | |
29 | {↵ | 29 | {↵ | |
30 | dispatchNotification(notification);↵ | 30 | dispatchNotification(notification);↵ | |
31 | }↵ | 31 | }↵ | |
32 | else↵ | 32 | else↵ | |
33 | {↵ | 33 | {↵ | |
34 | notifications.add(notification);↵ | 34 | notifications.add(notification);↵ | |
35 | notifications.dispatch();↵ | 35 | notifications.dispatch();↵ | |
36 | }↵ | 36 | }↵ | |
37 | }↵ | 37 | }↵ | |
38 | }↵ | 38 | }↵ | |
39 | else if (hasInverse())↵ | 39 | else if (hasInverse())↵ | |
40 | {↵ | 40 | {↵ | |
41 | NotificationChain notifications = createNotificationChain(collection.size());↵ | 41 | NotificationChain notifications = createNotificationChain(collection.size());↵ | |
42 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | 42 | for (Iterator<?> i = collection.iterator(); i.hasNext(); )↵ | |
43 | {↵ | 43 | {↵ | |
44 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | 44 | @SuppressWarnings("unchecked") E object = (E)i.next();↵ | |
45 | notifications = inverseRemove(object, notifications);↵ | 45 | notifications = inverseRemove(object, notifications);↵ | |
46 | }↵ | 46 | }↵ | |
47 | if (notifications != null) notifications.dispatch();↵ | 47 | if (notifications != null) notifications.dispatch();↵ | |
48 | }↵ | 48 | }↵ | |
49 | return true; | 49 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 108 |
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) | 6334.0 |
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.9 |
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 |