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[] toArray(EStructuralFeature, boolean)
|
Method name: T[] toArray(EStructuralFeature, T[], boolean)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | List<Object> result = new BasicEList<Object>();↵ | 1 | List<Object> result = new BasicEList<Object>();↵ | |
2 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);↵ | 2 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);↵ | |
3 | if (FeatureMapUtil.isFeatureMap(feature))↵ | 3 | if (FeatureMapUtil.isFeatureMap(feature))↵ | |
4 | {↵ | 4 | {↵ | |
5 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | 5 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | |
6 | {↵ | 6 | {↵ | |
7 | Entry entry = delegateGet(i);↵ | 7 | Entry entry = delegateGet(i);↵ | |
8 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 8 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
9 | {↵ | 9 | {↵ | |
10 | result.add(entry);↵ | 10 | result.add(entry);↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | else↵ | 14 | else↵ | |
15 | {↵ | 15 | {↵ | |
16 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | 16 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | |
17 | {↵ | 17 | {↵ | |
18 | Entry entry = delegateGet(i);↵ | 18 | Entry entry = delegateGet(i);↵ | |
19 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 19 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
20 | {↵ | 20 | {↵ | |
21 | Object value = entry.getValue();↵ | 21 | Object value = entry.getValue();↵ | |
22 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);↵ | 22 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);↵ | |
23 | }↵ | 23 | }↵ | |
24 | }↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | return result.toArray(); | 26 | return result.toArray(array); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
Number of mapped statements | 12 |
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) | 4.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | List<Object> result = new BasicEList<Object>(); | 1 | List<Object> result = new BasicEList<Object>(); | |
2 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); | 2 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); | |
3 | if (FeatureMapUtil.isFeatureMap(feature)) | 3 | if (FeatureMapUtil.isFeatureMap(feature)) | |
4 | for (int i = 0, size = delegateSize(); i < size; ++i) | 4 | for (int i = 0, size = delegateSize(); i < size; ++i) | |
5 | Entry entry = delegateGet(i); | 5 | Entry entry = delegateGet(i); | |
6 | if (validator.isValid(entry.getEStructuralFeature())) | 6 | if (validator.isValid(entry.getEStructuralFeature())) | |
7 | result.add(entry); | 7 | result.add(entry); | |
else | else | |||
8 | for (int i = 0, size = delegateSize(); i < size; ++i) | 8 | for (int i = 0, size = delegateSize(); i < size; ++i) | |
9 | Entry entry = delegateGet(i); | 9 | Entry entry = delegateGet(i); | |
10 | if (validator.isValid(entry.getEStructuralFeature())) | 10 | if (validator.isValid(entry.getEStructuralFeature())) | |
11 | Object value = entry.getValue(); | 11 | Object value = entry.getValue(); | |
12 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value); | 12 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value); | |
| 13 | return result.toArray(array); | ||
13 | return result.toArray(); | |
Row | Violation |
---|