File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java | |||
Method name: boolean validateEClass_ConsistentSuperTypes(EClass, DiagnosticChain, Map
|
Method name: boolean validateEClass_ConsistentSuperTypes(EClass, DiagnosticChain, Map
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | EClassifier eClassifier = eGenericSuperType.getEClassifier();↵ | 1 | EClassifier eClassifier = eGenericSuperType.getEClassifier();↵ | |
2 | if (eClassifier instanceof EClass)↵ | 2 | if (eClassifier instanceof EClass)↵ | |
3 | {↵ | 3 | {↵ | |
4 | int index = superTypes.indexOf(eClassifier);↵ | 4 | int index = superTypes.indexOf(eClassifier);↵ | |
5 | if (index != -1)↵ | 5 | if (index != -1)↵ | |
6 | {↵ | 6 | {↵ | |
7 | if (diagnostics == null)↵ | 7 | if (diagnostics == null)↵ | |
8 | {↵ | 8 | ↵ | |
9 | {↵ | |||
9 | return false;↵ | 10 | return false;↵ | |
10 | }↵ | 11 | }↵ | |
11 | else↵ | 12 | else↵ | |
12 | {↵ | 13 | {↵ | |
13 | result = false;↵ | 14 | result = false;↵ | |
14 | diagnostics.add↵ | 15 | diagnostics.add↵ | |
15 | (createDiagnostic↵ | 16 | (createDiagnostic↵ | |
16 | (Diagnostic.ERROR,↵ | 17 | (Diagnostic.ERROR,↵ | |
17 | DIAGNOSTIC_SOURCE,↵ | 18 | DIAGNOSTIC_SOURCE,↵ | |
18 | CONSISTENT_SUPER_TYPES_DUPLICATE,↵ | 19 | CONSISTENT_SUPER_TYPES_↵ | |
20 | CONFLICT,↵ | |||
19 | "_UI_EClassNoDuplicateSuperTypes_diagnostic",↵ | 21 | "_UI_EClassConsistentSuperTypes_diagnostic",↵ | |
20 | new Object [] { eGenericSuperTypes.indexOf(eGenericSuperType), index },↵ | 22 | new Object [] { getObjectLabel(eClassifier, context) },↵ | |
21 | new Object[] { eClass, eGenericSuperType, eGenericSuperTypes.get(index) },↵ | 23 | new Object[] { eClass, eGenericSuperType, eAllGenericSuperTypes.get(index) },↵ | |
22 | context));↵ | 24 | context));↵ | |
23 | }↵ | 25 | ↵ | |
26 | }↵ | |||
24 | }↵ | 27 | }↵ | |
25 | }↵ | 28 | ↵ | |
29 | }↵ | |||
26 | superTypes.add(eClassifier); | 30 | superTypes.add(eClassifier); | |
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 the same method |
Number of node comparisons | 27 |
Number of mapped statements | 9 |
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) | 12.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | EClassifier eClassifier = eGenericSuperType.getEClassifier(); | 18 | EClassifier eClassifier = eGenericSuperType.getEClassifier(); | ||||||||||||||||||||||
6 | if (eClassifier instanceof EClass) | 19 | if (eClassifier instanceof EClass) | ||||||||||||||||||||||
7 | int index = superTypes.indexOf(eClassifier); | 20 | int index = superTypes.indexOf(eClassifier); | ||||||||||||||||||||||
8 | if (index != -1) | 21 | if (index != -1) | ||||||||||||||||||||||
9 | if (diagnostics == null) | 22 | if (diagnostics == null) | ||||||||||||||||||||||
10 | return false; |
| 23 | return false; | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
11 | result = false; | 24 | result = false; | ||||||||||||||||||||||
12 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_DUPLICATE, "_UI_EClassNoDuplicateSuperTypes_diagnostic", new Object[] {eGenericSuperTypes.indexOf(eGenericSuperType), index}, new Object[] {eClass, eGenericSuperType, eGenericSuperTypes.get(index)}, context)); |
| 25 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_SUPER_TYPES_CONFLICT, "_UI_EClassConsistentSuperTypes_diagnostic", new Object[] {getObjectLabel(eClassifier, context)}, new Object[] {eClass, eGenericSuperType, eAllGenericSuperTypes.get(index)}, context)); | |||||||||||||||||||||
13 | superTypes.add(eClassifier); | 26 | superTypes.add(eClassifier); |
Row | Violation |
---|---|
1 | Expression new Object[]{eGenericSuperTypes.indexOf(eGenericSuperType),index} cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new Object[]{getObjectLabel(eClassifier,context)} cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Conditional return false; |
4 | Conditional return false; |