if (equalObjects(object, objects[j]))
{
if (count != j)
{
Object x = objects[count];
objects[count] = objects[j];
objects[j] = x;
}
positions[count++] = i;
break LOOP;
}
if (equalObjects(object, objects[j]))
{
if (count != j)
{
Object x = objects[count];
objects[count] = objects[j];
objects[j] = x;
}
positions[count++] = i.previousIndex();
break LOOP;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/DelegatingNotifyingListImpl.java
|
Method name: boolean removeAll(Collection>)
|
|
Method name: boolean removeAll(Collection>)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (equalObjects(object, objects[j]))↵ | | 1 | if (equalObjects(object, objects[j]))↵
|
2 | {↵ | | 2 | {↵
|
3 | if (count != j)↵ | | 3 | if (count != j)↵
|
4 | {↵ | | 4 | {↵
|
5 | Object x = objects[count];↵ | | 5 | Object x = objects[count];↵
|
6 | objects[count] = objects[j];↵ | | 6 | objects[count] = objects[j];↵
|
7 | objects[j] = x;↵ | | 7 | objects[j] = x;↵
|
8 | }↵ | | 8 | }↵
|
9 | positions[count++] = i;↵ | | 9 | positions[count++] = i.previousIndex();↵
|
10 | break LOOP;↵ | | 10 | break LOOP;↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 51 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 3.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if (equalObjects(object, objects[j])) | | 18 | if (equalObjects(object, objects[j])) |
19 | | | 19 | |
20 | Object x = objects[count]; | | 20 | Object x = objects[count]; |
21 | objects[count] = objects[j]; | | 21 | objects[count] = objects[j]; |
22 | | | 22 | |
23 | | | 23 | positions[count++] = i.previousIndex(); |
24 | | | 24 | |
Precondition Violations (3)
Row |
Violation |
1 | Statement break LOOP; without innermost loop |
2 | Statement break LOOP; without innermost loop |
3 | Clone fragment #1 returns variables count, objects, positions , while Clone fragment #2 returns variables count, objects, positions |