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 contains(Object)
|
Method name: int indexOf(Object)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (useEquals() && object != null)↵ | 1 | if (useEquals() && object != null)↵ | |
2 | {↵ | 2 | {↵ | |
3 | for (int i = 0; i < size; ++i)↵ | 3 | for (int i = 0; i < size; ++i)↵ | |
4 | {↵ | 4 | {↵ | |
5 | if (object.equals(data[i]))↵ | 5 | if (object.equals(data[i]))↵ | |
6 | {↵ | 6 | {↵ | |
7 | return true;↵ | 7 | return i;↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | else↵ | 11 | else↵ | |
12 | {↵ | 12 | {↵ | |
13 | for (int i = 0; i < size; ++i)↵ | 13 | for (int i = 0; i < size; ++i)↵ | |
14 | {↵ | 14 | {↵ | |
15 | if (data[i] == object)↵ | 15 | if (data[i] == object)↵ | |
16 | {↵ | 16 | {↵ | |
17 | return true;↵ | 17 | return i;↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | } | 20 |
| |
See real code fragment | See real code fragment |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | if (useEquals() && object != null) | 1 | if (useEquals() && object != null) | |||||
2 | for (int i = 0; i < size; ++i) | 2 | for (int i = 0; i < size; ++i) | |||||
3 | if (object.equals(data[i])) | 3 | if (object.equals(data[i])) | |||||
|
| 4 | return i; | |||||
4 | return true; |
| | |||||
else | else | |||||||
5 | for (int i = 0; i < size; ++i) | 5 | for (int i = 0; i < size; ++i) | |||||
6 | if (data[i] == object) | 6 | if (data[i] == object) | |||||
|
| 7 | return i; | |||||
7 | return true; |
| |
Row | Violation |
---|---|
1 | Unmatched statement return i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return i; |
3 | Unmatched return true; |
4 | Unmatched statement return i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return i; |
6 | Unmatched return true; |
7 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables i, i |