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[] toArray(EStructuralFeature, boolean)
|
Method name: T[] toArray(EStructuralFeature, T[], boolean)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
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 | Entry [] entries = (Entry[])data;↵ | 3 | Entry [] entries = (Entry[])data;↵ | |
4 | if (FeatureMapUtil.isFeatureMap(feature))↵ | 4 | if (FeatureMapUtil.isFeatureMap(feature))↵ | |
5 | {↵ | 5 | {↵ | |
6 | for (int i = 0; i < size; ++i)↵ | 6 | for (int i = 0; i < size; ++i)↵ | |
7 | {↵ | 7 | {↵ | |
8 | Entry entry = entries[i];↵ | 8 | Entry entry = entries[i];↵ | |
9 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 9 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
10 | {↵ | 10 | {↵ | |
11 | result.add(entry);↵ | 11 | result.add(entry);↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | else↵ | 15 | else↵ | |
16 | {↵ | 16 | {↵ | |
17 | for (int i = 0; i < size; ++i)↵ | 17 | for (int i = 0; i < size; ++i)↵ | |
18 | {↵ | 18 | {↵ | |
19 | Entry entry = entries[i];↵ | 19 | Entry entry = entries[i];↵ | |
20 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 20 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
21 | {↵ | 21 | {↵ | |
22 | Object value = entry.getValue();↵ | 22 | Object value = entry.getValue();↵ | |
23 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);↵ | 23 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value);↵ | |
24 | }↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | }↵ | 26 | }↵ | |
27 | return result.toArray(); | 27 | 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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 47 |
Number of mapped statements | 13 |
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.2 |
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 | Entry[] entries = (Entry[])data; | 3 | Entry[] entries = (Entry[])data; | |
4 | if (FeatureMapUtil.isFeatureMap(feature)) | 4 | if (FeatureMapUtil.isFeatureMap(feature)) | |
5 | for (int i = 0; i < size; ++i) | 5 | for (int i = 0; i < size; ++i) | |
6 | Entry entry = entries[i]; | 6 | Entry entry = entries[i]; | |
7 | if (validator.isValid(entry.getEStructuralFeature())) | 7 | if (validator.isValid(entry.getEStructuralFeature())) | |
8 | result.add(entry); | 8 | result.add(entry); | |
else | else | |||
9 | for (int i = 0; i < size; ++i) | 9 | for (int i = 0; i < size; ++i) | |
10 | Entry entry = entries[i]; | 10 | Entry entry = entries[i]; | |
11 | if (validator.isValid(entry.getEStructuralFeature())) | 11 | if (validator.isValid(entry.getEStructuralFeature())) | |
12 | Object value = entry.getValue(); | 12 | Object value = entry.getValue(); | |
13 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value); | 13 | result.add(resolve ? resolveProxy(feature, i, result.size(), value) : value); | |
| 14 | return result.toArray(array); | ||
14 | return result.toArray(); | |
Row | Violation |
---|