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: 6 | Number of AST nodes: 6 | |||
1 | int index = superTypes.indexOf(eClassifier);↵ | 1 | int index = superTypes.indexOf(eClassifier);↵ | |
2 | if (index != -1)↵ | 2 | if (index != -1)↵ | |
3 | {↵ | 3 | ↵ | |
4 | ↵ | 4 | {↵ | |
5 | if (diagnostics == null)↵ | 5 | if (diagnostics == null)↵ | |
6 | {↵ | 6 | {↵ | |
7 | return false;↵ | 7 | return false;↵ | |
8 | }↵ | 8 | }↵ | |
9 | else↵ | 9 | else↵ | |
10 | {↵ | 10 | {↵ | |
11 | result = false;↵ | 11 | result = false;↵ | |
12 | diagnostics.add↵ | 12 | diagnostics.add↵ | |
13 | (createDiagnostic↵ | 13 | (createDiagnostic↵ | |
14 | (Diagnostic.ERROR,↵ | 14 | (Diagnostic.ERROR,↵ | |
15 | DIAGNOSTIC_SOURCE,↵ | 15 | DIAGNOSTIC_SOURCE,↵ | |
16 | CONSISTENT_SUPER_TYPES_CONFLICT,↵ | 16 | CONSISTENT_SUPER_TYPES_↵ | |
17 | ↵ | 17 | DUPLICATE,↵ | |
18 | "_UI_EClassConsistentSuperTypes_diagnostic",↵ | 18 | "_UI_EClassNoDuplicateSuperTypes_diagnostic",↵ | |
19 | new Object [] { getObjectLabel(eClassifier, context) },↵ | 19 | new Object [] { eGenericSuperTypes.indexOf(eGenericSuperType), index },↵ | |
20 | new Object[] { eClass, eGenericSuperType, eAllGenericSuperTypes.get(index) },↵ | 20 | new Object[] { eClass, eGenericSuperType, eGenericSuperTypes.get(index) },↵ | |
21 | context));↵ | 21 | context));↵ | |
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 21 |
Number of mapped statements | 6 |
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) | 1524.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20 | int index = superTypes.indexOf(eClassifier); | 7 | int index = superTypes.indexOf(eClassifier); | |||||||||||||||||||||
21 | if (index != -1) | 8 | if (index != -1) | |||||||||||||||||||||
22 | if (diagnostics == null) | 9 | if (diagnostics == null) | |||||||||||||||||||||
23 | return false; |
| 10 | return false; | ||||||||||||||||||||
else | else | |||||||||||||||||||||||
24 | result = false; | 11 | result = false; | |||||||||||||||||||||
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)); |
| 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)); |
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 | Conditional return false; |
3 | Conditional return false; |