File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java | |||
Method name: boolean removeAll(Collection>)
|
Method name: boolean retainAll(Collection>)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | boolean modified = false;↵ | 1 | boolean modified = false;↵ | |
2 | for (int i = size; --i >= 0; )↵ | 2 | for (int i = size; --i >= 0; )↵ | |
3 | {↵ | 3 | {↵ | |
4 | if (collection.contains(data[i]))↵ | 4 | if (!collection.contains(data[i]))↵ | |
5 | {↵ | 5 | {↵ | |
6 | remove(i);↵ | 6 | remove(i);↵ | |
7 | modified = true;↵ | 7 | modified = true;↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | return modified; | 10 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 6 |
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) | 1932.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | boolean modified = false; | 1 | boolean modified = false; | |||||||||||||
2 | for (int i = size; --i >= 0; ) | 2 | for (int i = size; --i >= 0; ) | |||||||||||||
3 | if (collection.contains(data[i])) |
| 3 | if (!collection.contains(data[i])) | ||||||||||||
4 | remove(i); | 4 | remove(i); | |||||||||||||
5 | modified = true; | 5 | modified = true; | |||||||||||||
6 | return modified; | 6 | return modified; |
Row | Violation |
---|---|
1 | Expression collection.contains(data[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression !collection.contains(data[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |