int position = target.indexOf(copyReferencedEObject);
if (position == -1)
{
target.addUnique(index, copyReferencedEObject);
}
else if (index != position)
{
target.move(index, copyReferencedEObject);
}
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/util/EcoreUtil.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
Method name: void copyReference(EReference, EObject, EObject)
|
|
Method name: List setManyReference(ManyReference, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | int position = target.indexOf(copyReferencedEObject);↵ | | 1 | int index = list.basicIndexOf(value);↵
|
2 | if (position == -1)↵ | | 2 | if (index == -1)↵
|
3 | {↵ | | 3 | {↵
|
4 | target.addUnique(index, copyReferencedEObject);↵ | | 4 | list.addUnique(↵
|
5 | }↵ | | |
|
6 | else if (index != position)↵ | | |
|
7 | ↵ | | 5 | position, value);↵
|
| | | 6 | }↵
|
| | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | target.move(index, copyReferencedEObject);↵ | | 9 | ↵
|
10 | ↵ | | 10 | list.move(position, index);↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 2 |