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: 15 | Number of AST nodes: 15 | |||
1 | if (count > 0)↵ | 1 | if (count > 0)↵ | |
2 | {↵ | 2 | {↵ | |
3 | result = true;↵ | 3 | result = true;↵ | |
4 | if (hasShadow())↵ | 4 | if (hasShadow())↵ | |
5 | {↵ | 5 | {↵ | |
6 | // Remove from by position in reverse order.↵ | 6 | // Remove from by position in reverse order.↵ | |
7 | //↵ | 7 | //↵ | |
8 | for (int i = 0; i < count; ++i)↵ | 8 | for (int i = 0; i < count; ++i)↵ | |
9 | {↵ | 9 | {↵ | |
10 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵ | 10 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵ | |
11 | notifications = shadowRemove(object, notifications);↵ | 11 | notifications = shadowRemove(object, notifications);↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | // Remove from by position in reverse order.↵ | 14 | // Remove from by position in reverse order.↵ | |
15 | //↵ | 15 | //↵ | |
16 | for (int i = count; --i >= 0;)↵ | 16 | for (int i = count; --i >= 0;)↵ | |
17 | {↵ | 17 | {↵ | |
18 | doRemove(positions[i]);↵ | 18 | doRemove(positions[i]);↵ | |
19 | }↵ | 19 | }↵ | |
20 | // Compact the results to remove unmatched objects↵ | 20 | // Compact the results to remove unmatched objects↵ | |
21 | //↵ | 21 | //↵ | |
22 | if (count != listSize)↵ | 22 | if (count != listSize)↵ | |
23 | {↵ | 23 | {↵ | |
24 | for (int i = listSize; --i >= count; )↵ | 24 | for (int i = listSize; --i >= count; )↵ | |
25 | {↵ | 25 | {↵ | |
26 | list.remove(i);↵ | 26 | list.remove(i);↵ | |
27 | }↵ | 27 | }↵ | |
28 | int [] oldPositions = positions;↵ | 28 | int [] oldPositions = positions;↵ | |
29 | positions = new int [count];↵ | 29 | positions = new int [count];↵ | |
30 | System.arraycopy(oldPositions, 0, positions, 0, count);↵ | 30 | System.arraycopy(oldPositions, 0, positions, 0, count);↵ | |
31 | }↵ | 31 | }↵ | |
32 | collection = list;↵ | 32 | collection = list;↵ | |
33 | } | 33 |
| |
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 | 73 |
Number of mapped statements | 15 |
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.7 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
52 | if (count > 0) | 52 | if (count > 0) | |
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 |