int index = list.basicIndexOf(value);
if (index == -1)
{
list.addUnique(position, value);
}
else
{
list.move(position, index);
}
int index = list.basicIndexOf(value);
if (index == -1)
{
list.addUnique(position, value);
}
else
{
list.move(position, index);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
Method name: List setManyReference(ManyReference, String)
|
|
Method name: void setValue(EObject, EStructuralFeature, Object, int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | int index = list.basicIndexOf(value);↵ | | 1 | int index = list.basicIndexOf(value);↵
|
2 | if (index == -1)↵ | | 2 | if (index == -1)↵
|
3 | {↵ | | 3 | ↵
|
4 | ↵ | | 4 | {↵
|
5 | list.addUnique(position, value);↵ | | 5 | list.addUnique(position, value);↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | ↵
|
9 | ↵ | | 9 | {↵
|
10 | list.move(position, index);↵ | | 10 | list.move(position, index);↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 11 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | int index = list.basicIndexOf(value); | | 55 | int index = list.basicIndexOf(value); |
16 | if (index == -1) | | 56 | if (index == -1) |
17 | list.addUnique(position, value); | | 57 | list.addUnique(position, value); |
| | | | |
18 | list.move(position, index); | | 58 | list.move(position, index); |
Precondition Violations (0)
Row |
Violation |