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: Object remove(EStructuralFeature, int)
|
Method name: Object set(EStructuralFeature, int, Object)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | Entry entry = entries[i];↵ | 1 | Entry entry = entries[i];↵ | |
2 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 2 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
3 | {↵ | 3 | ↵ | |
4 | {↵ | |||
4 | if (count == index)↵ | 5 | if (count == index)↵ | |
5 | {↵ | 6 | {↵ | |
6 | remove(i);↵ | 7 | ↵ | |
7 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();↵ | 8 | return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));↵ | |
8 | }↵ | 9 | }↵ | |
9 | ++count;↵ | 10 | ++count;↵ | |
10 | } | 11 | } | |
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 | 12 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
5 | Entry entry = entries[i]; | 10 | Entry entry = entries[i]; | |||||
6 | if (validator.isValid(entry.getEStructuralFeature())) | 11 | if (validator.isValid(entry.getEStructuralFeature())) | |||||
7 | if (count == index) | 12 | if (count == index) | |||||
8 | remove(i); | | ||||||
9 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); |
| | |||||
|
| 13 | return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object)); | |||||
10 | ++count; | 14 | ++count; |
Row | Violation |
---|---|
1 | Unmatched statement return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); |
3 | Unmatched return doSet(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object)); |
4 | Clone fragment #1 returns variables entry, count , while Clone fragment #2 returns variables count |