int position = target.indexOf(copyReferencedEObject);
if (position == -1)
{
target.addUnique(index, copyReferencedEObject);
}
else if (index != position)
{
target.move(index, copyReferencedEObject);
}
int position = copyList.indexOf(target);
if (position == -1)
{
copyList.add(index, target);
}
else
{
copyList.move(index, target);
}
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/edit/command/InitializeCopyCommand.java
|
Method name: void copyReference(EReference, EObject, EObject)
|
|
Method name: void copyReferences()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | int position = target.indexOf(copyReferencedEObject);↵ | | 1 | int position = copyList.indexOf(↵
|
2 | ↵ | | 2 | target);↵
|
3 | if (position == -1)↵ | | 3 | if (position == -1)↵
|
4 | {↵ | | 4 | {↵
|
5 | target.addUnique(index, copyReferencedEObject);↵ | | 5 | ↵
|
6 | }↵ | | |
|
7 | else if (index != position)↵ | | |
|
8 | ↵ | | 6 | copyList.add(index, target);↵
|
| | | 7 | }↵
|
| | | 8 | else↵
|
9 | {↵ | | 9 | {↵
|
10 | target.move(index, copyReferencedEObject);↵ | | 10 | copyList.move(index, ↵
|
11 | ↵ | | 11 | target);↵
|
12 | } | | 12 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 2 |