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: 14 | Number of AST nodes: 14 | |||
1 | result = true;↵ | 1 | result = true;↵ | |
2 | if (hasShadow())↵ | 2 | if (hasShadow())↵ | |
3 | {↵ | 3 | {↵ | |
4 | // Remove from by position in reverse order.↵ | 4 | // Remove from by position in reverse order.↵ | |
5 | //↵ | 5 | //↵ | |
6 | for (int i = 0; i < count; ++i)↵ | 6 | for (int i = 0; i < count; ++i)↵ | |
7 | {↵ | 7 | {↵ | |
8 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵ | 8 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵ | |
9 | notifications = shadowRemove(object, notifications);↵ | 9 | notifications = shadowRemove(object, notifications);↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
12 | // Remove from by position in reverse order.↵ | 12 | // Remove from by position in reverse order.↵ | |
13 | //↵ | 13 | //↵ | |
14 | for (int i = count; --i >= 0;)↵ | 14 | for (int i = count; --i >= 0;)↵ | |
15 | {↵ | 15 | {↵ | |
16 | doRemove(positions[i]);↵ | 16 | doRemove(positions[i]);↵ | |
17 | }↵ | 17 | }↵ | |
18 | // Compact the results to remove unmatched objects↵ | 18 | // Compact the results to remove unmatched objects↵ | |
19 | //↵ | 19 | //↵ | |
20 | if (count != listSize)↵ | 20 | if (count != listSize)↵ | |
21 | {↵ | 21 | {↵ | |
22 | for (int i = listSize; --i >= count; )↵ | 22 | for (int i = listSize; --i >= count; )↵ | |
23 | {↵ | 23 | {↵ | |
24 | list.remove(i);↵ | 24 | list.remove(i);↵ | |
25 | }↵ | 25 | }↵ | |
26 | int [] oldPositions = positions;↵ | 26 | int [] oldPositions = positions;↵ | |
27 | positions = new int [count];↵ | 27 | positions = new int [count];↵ | |
28 | System.arraycopy(oldPositions, 0, positions, 0, count);↵ | 28 | System.arraycopy(oldPositions, 0, positions, 0, count);↵ | |
29 | }↵ | 29 | }↵ | |
30 | collection = list; | 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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 68 |
Number of mapped statements | 14 |
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) | 4.3 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
53 | result = true; | 53 | result = true; | |
54 | if (hasShadow()) | 54 | if (hasShadow()) | |
55 | for (int i = 0; i < count; ++i) | 55 | for (int i = 0; i < count; ++i) | |
56 | @SuppressWarnings("unchecked") E object = (E)objects[i]; | 56 | @SuppressWarnings("unchecked") E object = (E)objects[i]; | |
57 | notifications = shadowRemove(object, notifications); | 57 | notifications = shadowRemove(object, notifications); | |
58 | for (int i = count; --i >= 0; ) | 58 | for (int i = count; --i >= 0; ) | |
59 | doRemove(positions[i]); | 59 | doRemove(positions[i]); | |
60 | if (count != listSize) | 60 | if (count != listSize) | |
61 | for (int i = listSize; --i >= count; ) | 61 | for (int i = listSize; --i >= count; ) | |
62 | list.remove(i); | 62 | list.remove(i); | |
63 | int[] oldPositions = positions; | 63 | int[] oldPositions = positions; | |
64 | positions = new int[count]; | 64 | positions = new int[count]; | |
65 | System.arraycopy(oldPositions, 0, positions, 0, count); | 65 | System.arraycopy(oldPositions, 0, positions, 0, count); | |
66 | collection = list; | 66 | collection = list; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables result, positions, collection , while Clone fragment #2 returns variables result, positions, collection |