File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java | |||
Method name: Object set(EStructuralFeature, int, Object)
|
Method name: Object setUnique(EStructuralFeature, int, Object)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | 1 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | |
2 | {↵ | 2 | {↵ | |
3 | Entry entry = delegateGet(i);↵ | 3 | Entry entry = delegateGet(i);↵ | |
4 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 4 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
5 | {↵ | 5 | {↵ | |
6 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue();↵ | 6 | return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object));↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return null; | 9 | return feature.getDefaultValue(); | |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 33 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15 | for (int i = 0, size = delegateSize(); i < size; ++i) | 11 | for (int i = 0, size = delegateSize(); i < size; ++i) | |||||||||||
16 | Entry entry = delegateGet(i); | 12 | Entry entry = delegateGet(i); | |||||||||||
17 | if (validator.isValid(entry.getEStructuralFeature())) | 13 | if (validator.isValid(entry.getEStructuralFeature())) | |||||||||||
|
| 14 | return setUnique(i, FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature, object)); | |||||||||||
18 | return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); |
| | |||||||||||
19 | return null; |
| 15 | return feature.getDefaultValue(); |
Row | Violation |
---|---|
1 | Unmatched statement return setUnique(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return setUnique(i,FeatureMapUtil.isFeatureMap(feature) ? (Entry)object : createEntry(feature,object)); |
3 | 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 |
4 | Unmatched return FeatureMapUtil.isFeatureMap(feature) ? entry : entry.getValue(); |
5 | 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 |