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: NotificationChain basicRemove(EStructuralFeature, Object, NotificationChain)
|
Method name: boolean remove(EStructuralFeature, Object)
|
|||
Number of AST nodes: 7 | 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.equals(object))↵ | 6 | if (entry.equals(object))↵ | |
7 | {↵ | 7 | {↵ | |
8 | match = entry;↵ | 8 | remove(i);↵ | |
9 | break;↵ | 9 | return true;↵ | |
10 | }↵ | 10 | }↵ | |
11 | ++count;↵ | |||
12 | }↵ | 11 | }↵ | |
13 | } | 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) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
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 | ||||
---|---|---|---|---|---|---|---|
6 | for (int i = 0; i < size; ++i) | 4 | for (int i = 0; i < size; ++i) | ||||
7 | Entry entry = entries[i]; | 5 | Entry entry = entries[i]; | ||||
8 | if (validator.isValid(entry.getEStructuralFeature())) | 6 | if (validator.isValid(entry.getEStructuralFeature())) | ||||
9 | if (entry.equals(object)) | 7 | if (entry.equals(object)) | ||||
|
| 8 | remove(i); | ||||
|
| 9 | return true; | ||||
10 | match = entry; |
| | ||||
11 | break; |
| | ||||
12 | ++count; |
| |
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 statement match=entry; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched break; |
5 | Unmatched statement ++count; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variable entry with type org.eclipse.emf.ecore.util.FeatureMap.Entry , while Clone fragment #2 returns variable i with type int |