File path: /emf-2.4.1/src/org/eclipse/emf/common/util/ECollections.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/ECollections.java | |||
Method name: void sort(EList>)
|
Method name: void sort(EList
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for (int i=0; i < listAsArray.length; i++)↵ | 1 | for (int i=0; i < listAsArray.length; i++)↵ | |
2 | {↵ | 2 | {↵ | |
3 | int oldIndex = indexOf(list, listAsArray[i], i);↵ | 3 | int oldIndex = indexOf(list, listAsArray[i], i);↵ | |
4 | if (i != oldIndex)↵ | 4 | if (i != oldIndex)↵ | |
5 | {↵ | 5 | {↵ | |
6 | list.move(i, oldIndex);↵ | 6 | list.move(i, oldIndex);↵ | |
7 | }↵ | 7 | }↵ | |
8 | } | 8 |
| |
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 | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | for (int i = 0; i < listAsArray.length; i++) | 4 | for (int i = 0; i < listAsArray.length; i++) | ||||||||||||
4 | int oldIndex = indexOf(list, listAsArray[i], i); |
| 5 | int oldIndex = indexOf(list, listAsArray[i], i); | |||||||||||
5 | if (i != oldIndex) | 6 | if (i != oldIndex) | ||||||||||||
6 | list.move(i, oldIndex); |
| | ||||||||||||
|
| 7 | list.move(i, oldIndex); |
Row | Violation |
---|---|
1 | Type org.eclipse.emf.common.util.EList<> of variable list does not match with type org.eclipse.emf.common.util.EList<T> of variable list |
2 | Unmatched statement list.move(i,oldIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement list.move(i,oldIndex); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables i, oldIndex , while Clone fragment #2 returns variables i, oldIndex |