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 clear()
|
Method name: void clear()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (size > 0)↵ | 1 | if (size > 0)↵ | |
2 | {↵ | 2 | {↵ | |
3 | Object [] oldData = delegateToArray();↵ | 3 | Object [] oldData = data;↵ | |
4 | int oldSize = size;↵ | 4 | int oldSize = size;↵ | |
5 | doClear(size, oldData);↵ | 5 | doClear();↵ | |
6 | NotificationChain notifications = createNotificationChain(oldSize);↵ | 6 | NotificationChain notifications = createNotificationChain(oldSize);↵ | |
7 | for (int i = 0; i < oldSize; ++i)↵ | 7 | for (int i = 0; i < oldSize; ++i)↵ | |
8 | {↵ | 8 | {↵ | |
9 | @SuppressWarnings("unchecked") E object = (E)oldData[i];↵ | 9 | @SuppressWarnings("unchecked") E object = (E)oldData[i];↵ | |
10 | notifications = inverseRemove(object, notifications);↵ | 10 | notifications = inverseRemove(object, notifications);↵ | |
11 | }↵ | 11 | }↵ | |
12 | if (notifications != null) notifications.dispatch();↵ | 12 | if (notifications != null) notifications.dispatch();↵ | |
13 | }↵ | 13 | }↵ | |
14 | else ↵ | 14 | else ↵ | |
15 | {↵ | 15 | {↵ | |
16 | doClear();↵ | 16 | doClear();↵ | |
17 | } | 17 |
| |
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 different classes having the same super class |
Number of node comparisons | 57 |
Number of mapped statements | 11 |
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) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28 | if (size > 0) | 27 | if (size > 0) | ||||||||||||||
29 | Object[] oldData = delegateToArray(); |
| 28 | Object[] oldData = data; | |||||||||||||
30 | int oldSize = size; | 29 | int oldSize = size; | ||||||||||||||
31 | doClear(size, oldData); |
| 30 | doClear(); | |||||||||||||
32 | NotificationChain notifications = createNotificationChain(oldSize); | 31 | NotificationChain notifications = createNotificationChain(oldSize); | ||||||||||||||
33 | for (int i = 0; i < oldSize; ++i) | 32 | for (int i = 0; i < oldSize; ++i) | ||||||||||||||
34 | @SuppressWarnings("unchecked") E object = (E)oldData[i]; | 33 | @SuppressWarnings("unchecked") E object = (E)oldData[i]; | ||||||||||||||
35 | notifications = inverseRemove(object, notifications); | 34 | notifications = inverseRemove(object, notifications); | ||||||||||||||
36 | if (notifications != null) | 35 | if (notifications != null) | ||||||||||||||
37 | notifications.dispatch(); | 36 | notifications.dispatch(); | ||||||||||||||
else | else | ||||||||||||||||
38 | doClear(); | 37 | doClear(); |
Row | Violation |
---|---|
1 | Expression doClear(size,oldData) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression doClear(size,oldData) is a void method call, and thus it cannot be parameterized |
3 | Expression doClear() is a void method call, and thus it cannot be parameterized |