File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java | |||
Method name: boolean remove(EStructuralFeature, Object)
|
Method name: int indexOf(EStructuralFeature, Object, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for (int i = 0; i < size; ++i)↵ | 1 | for (int i = 0; i < size; ++i)↵ | |
2 | {↵ | 2 | {↵ | |
3 | Entry entry = entries[i];↵ | 3 | Entry entry = entries[i];↵ | |
4 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 4 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
5 | {↵ | 5 | {↵ | |
6 | if (entry.getValue() == null)↵ | 6 | if (entry.getValue() == null)↵ | |
7 | {↵ | 7 | {↵ | |
8 | remove(i);↵ | 8 | return result;↵ | |
9 | return true;↵ | 9 | }↵ | |
10 | }↵ | 10 | ++result;↵ | |
11 | }↵ | 11 | }↵ | |
12 | } | 12 |
| |
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) | 1.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 49 |
Number of mapped statements | 4 |
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 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
17 | for (int i = 0; i < size; ++i) | 26 | for (int i = 0; i < size; ++i) | ||||
18 | Entry entry = entries[i]; | 27 | Entry entry = entries[i]; | ||||
19 | if (validator.isValid(entry.getEStructuralFeature())) | 28 | if (validator.isValid(entry.getEStructuralFeature())) | ||||
20 | if (entry.getValue() == null) | 29 | if (entry.getValue() == null) | ||||
21 | remove(i); |
| | ||||
22 | return true; |
| | ||||
|
| 30 | return result; | ||||
|
| 31 | ++result; |
Row | Violation |
---|---|
1 | Unmatched statement remove(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return true; |
3 | Unmatched return result; |
4 | Unmatched statement ++result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables i , while Clone fragment #2 returns variables |