for (int i = start; i < end; ++i)
{
@SuppressWarnings("unchecked") E object = (E)objects[i];
assign(index, validate(index, object));
didAdd(index, object);
didChange();
++index;
}
return growth != 0;
for (int i = start; i < end; ++i)
{
@SuppressWarnings("unchecked") E object = (E)objects[i];
assign(index, validate(index, object));
didAdd(index, object);
didChange();
++index;
}
return growth != 0;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java
|
Method name: boolean addAllUnique(Object[], int, int)
|
|
Method name: boolean addAllUnique(int, Object[], int, int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | for (int i = start; i < end; ++i)↵ | | 1 | for (int i = start; i < end; ++i)↵
|
2 | {↵ | | 2 | {↵
|
3 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵ | | 3 | @SuppressWarnings("unchecked") E object = (E)objects[i];↵
|
4 | assign(index, validate(index, object));↵ | | 4 | assign(index, validate(index, object));↵
|
5 | didAdd(index, object);↵ | | 5 | didAdd(index, object);↵
|
6 | didChange();↵ | | 6 | didChange();↵
|
7 | ++index;↵ | | 7 | ++index;↵
|
8 | }↵ | | 8 | }↵
|
|
9 | return growth != 0; | | 9 | return growth != 0;
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
-
{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) | 1.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | for (int i = start; i < end; ++i) | | 7 | for (int i = start; i < end; ++i) |
6 | @SuppressWarnings("unchecked") E object = (E)objects[i]; | | 8 | @SuppressWarnings("unchecked") E object = (E)objects[i]; |
7 | assign(index, validate(index, object)); | | 9 | assign(index, validate(index, object)); |
8 | | | 10 | |
9 | | | 11 | |
10 | | | 12 | |
11 | return growth != 0; | | 13 | return growth != 0; |
Precondition Violations (0)
Row |
Violation |