File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java | |||
Method name: List
|
Method name: List
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | List<EClass> superTypes = eClass.getESuperTypes();↵ | 1 | List<EClass> superTypes = eClass.getESuperTypes();↵ | |
2 | List<EStructuralFeature> result = null;↵ | 2 | List<EStructuralFeature> result = null;↵ | |
3 | boolean changeable = false;↵ | 3 | boolean changeable = false;↵ | |
4 | for (int i = 0, size = superTypes.size(); i < size; ++i) ↵ | 4 | for (int i = 0, size = superTypes.size(); i < size; ++i) ↵ | |
5 | {↵ | 5 | {↵ | |
6 | EClass eSuperType = superTypes.get(i);↵ | 6 | EClass eSuperType = superTypes.get(i);↵ | |
7 | List<EStructuralFeature> allAttributes = getAllAttributes(eSuperType);↵ | 7 | List<EStructuralFeature> allElements = getAllElements(eSuperType);↵ | |
8 | if (!allAttributes.isEmpty())↵ | 8 | if (!allElements.isEmpty())↵ | |
9 | {↵ | 9 | {↵ | |
10 | if (result == null)↵ | 10 | if (result == null)↵ | |
11 | {↵ | 11 | {↵ | |
12 | result = allAttributes;↵ | 12 | result = allElements;↵ | |
13 | }↵ | 13 | }↵ | |
14 | else↵ | 14 | else↵ | |
15 | {↵ | 15 | {↵ | |
16 | if (!changeable)↵ | 16 | if (!changeable)↵ | |
17 | {↵ | 17 | {↵ | |
18 | changeable = true;↵ | 18 | changeable = true;↵ | |
19 | result = new UniqueEList<EStructuralFeature>(result);↵ | 19 | result = new UniqueEList<EStructuralFeature>(result);↵ | |
20 | }↵ | 20 | }↵ | |
21 | result.addAll(allAttributes);↵ | 21 | result.addAll(allElements);↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | } | 24 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 10.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | List<EClass> superTypes = eClass.getESuperTypes(); | 1 | List<EClass> superTypes = eClass.getESuperTypes(); | ||||||||||||||||
2 | List<EStructuralFeature> result = null; | 2 | List<EStructuralFeature> result = null; | ||||||||||||||||
3 | boolean changeable = false; | 3 | boolean changeable = false; | ||||||||||||||||
4 | for (int i = 0, size = superTypes.size(); i < size; ++i) | 4 | for (int i = 0, size = superTypes.size(); i < size; ++i) | ||||||||||||||||
5 | EClass eSuperType = superTypes.get(i); | 5 | EClass eSuperType = superTypes.get(i); | ||||||||||||||||
6 | List<EStructuralFeature> allAttributes = getAllAttributes(eSuperType); |
| 6 | List<EStructuralFeature> allElements = getAllElements(eSuperType); | |||||||||||||||
7 | if (!allAttributes.isEmpty()) |
| 7 | if (!allElements.isEmpty()) | |||||||||||||||
8 | if (result == null) | 8 | if (result == null) | ||||||||||||||||
9 | result = allAttributes; |
| 9 | result = allElements; | |||||||||||||||
else | else | ||||||||||||||||||
10 | if (!changeable) | 10 | if (!changeable) | ||||||||||||||||
11 | changeable = true; | 11 | changeable = true; | ||||||||||||||||
12 | result = new UniqueEList<EStructuralFeature>(result); | 12 | result = new UniqueEList<EStructuralFeature>(result); | ||||||||||||||||
13 | result.addAll(allAttributes); |
| 13 | result.addAll(allElements); |
Row | Violation |
---|---|
1 | Expression getAllAttributes(eSuperType) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression getAllElements(eSuperType) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables result, changeable , while Clone fragment #2 returns variables result, changeable |