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/DelegatingFeatureMap.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 = ↵ | |
2 | delegateGet(i);↵ | |||
2 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 3 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
3 | {↵ | 4 | ↵ | |
5 | {↵ | |||
4 | if (count == index)↵ | 6 | if (count == index)↵ | |
5 | {↵ | 7 | {↵ | |
6 | remove(i);↵ | 8 | ↵ | |
7 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();↵ | 9 | return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));↵ | |
8 | }↵ | 10 | }↵ | |
9 | ++count;↵ | 11 | ++count;↵ | |
10 | } | 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 in different classes having the same super 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.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | Entry entry = entries[i]; |
| 9 | Entry entry = delegateGet(i); | ||||||||||
6 | if (validator.isValid(entry.getEStructuralFeature())) | 10 | if (validator.isValid(entry.getEStructuralFeature())) | |||||||||||
7 | if (count == index) | 11 | if (count == index) | |||||||||||
8 | remove(i); | | ||||||||||||
9 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); |
| | |||||||||||
|
| 12 | return doSet(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object)); | |||||||||||
10 | ++count; | 13 | ++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 |