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: void addUnique(E)
|
Method name: void addUnique(E)
|
|||
Number of AST nodes: 19 | Number of AST nodes: 19 | |||
1 | if (isNotificationRequired())↵ | 1 | if (isNotificationRequired())↵ | |
2 | {↵ | 2 | {↵ | |
3 | int index = size();↵ | 3 | int index = size;↵ | |
4 | boolean oldIsSet = isSet();↵ | 4 | boolean oldIsSet = isSet();↵ | |
5 | doAddUnique(index, object);↵ | 5 | doAddUnique(object);↵ | |
6 | NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);↵ | 6 | NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet);↵ | |
7 | if (hasInverse())↵ | 7 | if (hasInverse())↵ | |
8 | {↵ | 8 | {↵ | |
9 | NotificationChain notifications = inverseAdd(object, null);↵ | 9 | NotificationChain notifications = inverseAdd(object, null);↵ | |
10 | if (hasShadow())↵ | 10 | if (hasShadow())↵ | |
11 | {↵ | 11 | {↵ | |
12 | notifications = shadowAdd(object, notifications);↵ | 12 | notifications = shadowAdd(object, notifications);↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (notifications == null)↵ | 14 | if (notifications == null)↵ | |
15 | {↵ | 15 | {↵ | |
16 | dispatchNotification(notification);↵ | 16 | dispatchNotification(notification);↵ | |
17 | }↵ | 17 | }↵ | |
18 | else↵ | 18 | else↵ | |
19 | {↵ | 19 | {↵ | |
20 | notifications.add(notification);↵ | 20 | notifications.add(notification);↵ | |
21 | notifications.dispatch();↵ | 21 | notifications.dispatch();↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | else↵ | 24 | else↵ | |
25 | {↵ | 25 | {↵ | |
26 | dispatchNotification(notification);↵ | 26 | dispatchNotification(notification);↵ | |
27 | }↵ | 27 | }↵ | |
28 | }↵ | 28 | }↵ | |
29 | else↵ | 29 | else↵ | |
30 | {↵ | 30 | {↵ | |
31 | doAddUnique(object);↵ | 31 | doAddUnique(object);↵ | |
32 | if (hasInverse())↵ | 32 | if (hasInverse())↵ | |
33 | {↵ | 33 | {↵ | |
34 | NotificationChain notifications = inverseAdd(object, null);↵ | 34 | NotificationChain notifications = inverseAdd(object, null);↵ | |
35 | if (notifications != null) notifications.dispatch();↵ | 35 | if (notifications != null) notifications.dispatch();↵ | |
36 | }↵ | 36 | }↵ | |
37 | } | 37 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 89 |
Number of mapped statements | 19 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (isNotificationRequired()) | 1 | if (isNotificationRequired()) | ||||||||||||||
2 | int index = size(); |
| 2 | int index = size; | |||||||||||||
3 | boolean oldIsSet = isSet(); | 3 | boolean oldIsSet = isSet(); | ||||||||||||||
4 | doAddUnique(index, object); |
| 4 | doAddUnique(object); | |||||||||||||
5 | NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet); | 5 | NotificationImpl notification = createNotification(Notification.ADD, null, object, index, oldIsSet); | ||||||||||||||
6 | if (hasInverse()) | 6 | if (hasInverse()) | ||||||||||||||
7 | NotificationChain notifications = inverseAdd(object, null); | 7 | NotificationChain notifications = inverseAdd(object, null); | ||||||||||||||
8 | if (hasShadow()) | 8 | if (hasShadow()) | ||||||||||||||
9 | notifications = shadowAdd(object, notifications); | 9 | notifications = shadowAdd(object, notifications); | ||||||||||||||
10 | if (notifications == null) | 10 | if (notifications == null) | ||||||||||||||
11 | dispatchNotification(notification); | 11 | dispatchNotification(notification); | ||||||||||||||
else | else | ||||||||||||||||
12 | notifications.add(notification); | 12 | notifications.add(notification); | ||||||||||||||
13 | notifications.dispatch(); | 13 | notifications.dispatch(); | ||||||||||||||
else | else | ||||||||||||||||
14 | dispatchNotification(notification); | 14 | dispatchNotification(notification); | ||||||||||||||
else | else | ||||||||||||||||
15 | doAddUnique(object); | 15 | doAddUnique(object); | ||||||||||||||
16 | if (hasInverse()) | 16 | if (hasInverse()) | ||||||||||||||
17 | NotificationChain notifications = inverseAdd(object, null); | 17 | NotificationChain notifications = inverseAdd(object, null); | ||||||||||||||
18 | if (notifications != null) | 18 | if (notifications != null) | ||||||||||||||
19 | notifications.dispatch(); | 19 | notifications.dispatch(); |
Row | Violation |
---|---|
1 | Expression doAddUnique(index,object) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression doAddUnique(index,object) is a void method call, and thus it cannot be parameterized |
3 | Expression doAddUnique(object) is a void method call, and thus it cannot be parameterized |