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 validateEClass_WellFormedMapEntryClass(EClass, DiagnosticChain, Map
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (eContainer instanceof EAttribute)↵ | 1 | if (e↵ | |
2 | {↵ | |||
3 | // The classifier of an attribute's generic type must be a data type.↵ | |||
4 | //↵ | |||
5 | ↵ | 2 | SuperType.getInstanceClassName() == "java.util.Map$Entry")↵ | |
3 | {↵ | |||
6 | if (diagnostics == null)↵ | 4 | if (diagnostics == null)↵ | |
7 | {↵ | 5 | ↵ | |
8 | ↵ | 6 | {↵ | |
9 | return false;↵ | 7 | return false;↵ | |
10 | }↵ | 8 | }↵ | |
11 | else↵ | 9 | else↵ | |
12 | {↵ | 10 | ↵ | |
13 | ↵ | 11 | {↵ | |
14 | result = false;↵ | 12 | result = false;↵ | |
15 | diagnostics.add↵ | 13 | diagnostics.add↵ | |
16 | (createDiagnostic↵ | 14 | (createDiagnostic↵ | |
17 | (Diagnostic.ERROR,↵ | 15 | (Diagnostic.ERROR,↵ | |
18 | DIAGNOSTIC_SOURCE,↵ | 16 | DIAGNOSTIC_SOURCE,↵ | |
19 | CONSISTENT_TYPE_CLASS_NOT_PERMITTED,↵ | 17 | ↵ | |
20 | "_UI_EAttributeNoDataTyp↵ | 18 | WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME,↵ | |
21 | e_diagnostic",↵ | 19 | "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic",↵ | |
22 | null,↵ | 20 | null,↵ | |
23 | new Object[] { eGenericType },↵ | 21 | new Object[] { e↵ | |
24 | ↵ | 22 | Class },↵ | |
25 | context));↵ | 23 | context));↵ | |
26 | }↵ | 24 | ↵ | |
27 | ↵ | 25 | }↵ | |
28 | } | 26 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 3 |
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) | 1.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
50 | if (diagnostics == null) | 17 | if (diagnostics == null) | |||||||
51 | return false; |
| 18 | return false; | ||||||
else | else | |||||||||
52 | result = false; | 19 | result = false; | |||||||
|
| 20 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME, "_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic", null, new Object[] {eClass}, context)); | |||||||
53 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_TYPE_CLASS_NOT_PERMITTED, "_UI_EAttributeNoDataType_diagnostic", null, new Object[] {eGenericType}, context)); |
| |
Row | Violation |
---|---|
1 | Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_MAP_ENTRY_NO_INSTANCE_CLASS_NAME,"_UI_EClassNotWellFormedMapEntryNoInstanceClassName_diagnostic",null,new Object[]{eClass},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,CONSISTENT_TYPE_CLASS_NOT_PERMITTED,"_UI_EAttributeNoDataType_diagnostic",null,new Object[]{eGenericType},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Conditional return false; |
4 | Conditional return false; |