File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/InitializeCopyCommand.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java | |||
Method name: void copyReferences()
|
Method name: List
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | int position = copyList.indexOf(target);↵ | 1 | int index = list.basicIndexOf(value);↵ | |
2 | if (position == -1)↵ | 2 | if (index == -1)↵ | |
3 | {↵ | 3 | {↵ | |
4 | copyList.add(index, target);↵ | 4 | list.addUnique(position, value);↵ | |
5 | }↵ | 5 | }↵ | |
6 | else↵ | 6 | else↵ | |
7 | {↵ | 7 | {↵ | |
8 | copyList.move(index, target);↵ | 8 | list.move(position, index);↵ | |
9 | } | 9 |
| |
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 in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 15 | int index = list.basicIndexOf(value); | |||||||||||
21 | int position = copyList.indexOf(target); |
| | |||||||||||
22 | if (position == -1) |
| 16 | if (index == -1) | ||||||||||
| 17 | list.addUnique(position, value); | ||||||||||||
23 | copyList.add(index, target); | | ||||||||||||
else | | |||||||||||||
| 18 | list.move(position, index); | ||||||||||||
24 | copyList.move(index, target); | |
Row | Violation |
---|---|
1 | Unmatched statement int index=list.basicIndexOf(value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement int position=copyList.indexOf(target); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |