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 validateEGenericType_ConsistentType(EGenericType, DiagnosticChain, Map
|
Method name: boolean validateEReference_ConsistentKeys(EReference, DiagnosticChain, Map
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (!(eGenericType.getEClassifier() instanceof EClass))↵ | 1 | if (↵ | |
2 | eClass.getFeatureID(eAttribute) == -1)↵ | |||
2 | {↵ | 3 | {↵ | |
3 | if (diagnostics == null)↵ | 4 | if (diagnostics == null)↵ | |
4 | {↵ | 5 | {↵ | |
5 | return false;↵ | 6 | return false;↵ | |
6 | }↵ | 7 | }↵ | |
7 | else↵ | 8 | else↵ | |
8 | {↵ | 9 | {↵ | |
9 | result = false;↵ | 10 | result = false;↵ | |
10 | diagnostics.add↵ | 11 | diagnostics.add↵ | |
11 | (createDiagnostic↵ | 12 | (createDiagnostic↵ | |
12 | (Diagnostic.ERROR,↵ | 13 | (Diagnostic.ERROR,↵ | |
13 | DIAGNOSTIC_SOURCE,↵ | 14 | DIAGNOSTIC_SOURCE,↵ | |
14 | CONSISTENT_TYPE_CLASS_REQUIRED,↵ | 15 | CONSISTENT_↵ | |
15 | "_UI_EGenericTypeNoClass_diagnostic",↵ | |||
16 | null,↵ | |||
16 | KEYS,↵ | |||
17 | "_UI_EReferenceConsistentKeys_diagnostic",↵ | |||
18 | new Object[] { getObjectLabel(eAttribute, context) },↵ | |||
17 | new Object[] { eGenericType },↵ | 19 | new Object[] { eReference, eAttribute },↵ | |
18 | context));↵ | 20 | context));↵ | |
19 | }↵ | 21 | ↵ | |
22 | }↵ | |||
20 | } | 23 | } | |
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) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 4 |
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) | 8.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28 | if (diagnostics == null) | 8 | if (diagnostics == null) | ||||||||||||||||||||
29 | return false; | 9 | return false; | ||||||||||||||||||||
else | else | ||||||||||||||||||||||
30 | result = false; | 10 | result = false; | ||||||||||||||||||||
31 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_TYPE_CLASS_REQUIRED, "_UI_EGenericTypeNoClass_diagnostic", null, new Object[] {eGenericType}, context)); |
| 11 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_KEYS, "_UI_EReferenceConsistentKeys_diagnostic", new Object[] {getObjectLabel(eAttribute, context)}, new Object[] {eReference, eAttribute}, context)); |
Row | Violation |
---|