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 validateEPackage_UniqueSubpackageNames(EPackage, DiagnosticChain, Map
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | int index = superTypes.indexOf(eClassifier);↵ | 1 | int index = names.indexOf(name);↵ | |
2 | if (index != -1)↵ | 2 | if (index != -1)↵ | |
3 | {↵ | 3 | ↵ | |
4 | ↵ | 4 | {↵ | |
5 | if (diagnostics == null)↵ | 5 | if (diagnostics == null)↵ | |
6 | {↵ | 6 | ↵ | |
7 | ↵ | 7 | {↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | ↵ | |
10 | ↵ | 10 | }↵ | |
11 | else↵ | 11 | else↵ | |
12 | {↵ | 12 | {↵ | |
13 | result = false;↵ | 13 | result = false;↵ | |
14 | ↵ | 14 | EPackage otherESubpackage = eSubpackages.get(index);↵ | |
15 | diagnostics.add↵ | 15 | diagnostics.add↵ | |
16 | (createDiagnostic↵ | 16 | (createDiagnostic↵ | |
17 | (Diagnostic.ERROR,↵ | 17 | (Diagnostic.ERROR,↵ | |
18 | DIAGNOSTIC_SOURCE,↵ | 18 | DIAGNOSTIC_SOURCE,↵ | |
19 | CONSISTENT_SUPER_TYPES_CONFLICT,↵ | 19 | ↵ | |
20 | ↵ | 20 | UNIQUE_SUBPACKAGE_NAMES,↵ | |
21 | "_UI_EClassConsistentSuperTypes_diagnostic",↵ | 21 | "_UI_EPackageUniqueSubpackageNames_diagnostic",↵ | |
22 | ↵ | 22 | ↵ | |
23 | new Object [] { getObjectLabel(eClassifier, context) },↵ | 23 | new Object[] { name },↵ | |
24 | new Object[] { eClass, eGenericSuperType, eAllGenericSuperTypes.get(index) },↵ | 24 | new Object[] { ePackage, eSubpackage, otherESubpackage },↵ | |
25 | context));↵ | 25 | context));↵ | |
26 | }↵ | 26 | ↵ | |
27 | ↵ | 27 | }↵ | |
28 | } | 28 |
| |
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 declared in the same class |
Number of node comparisons | 25 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20 | int index = superTypes.indexOf(eClassifier); |
| 7 | int index = names.indexOf(name); | |||||||||||||||||||||
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; | ||||||||||||||||||||||
|
| 12 | EPackage otherESubpackage = eSubpackages.get(index); | ||||||||||||||||||||||
|
| 13 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_SUBPACKAGE_NAMES, "_UI_EPackageUniqueSubpackageNames_diagnostic", new Object[] {name}, new Object[] {ePackage, eSubpackage, otherESubpackage}, 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)); |
| |
Row | Violation |
---|---|
1 | Type org.eclipse.emf.ecore.EClassifier of variable eClassifier does not match with type java.lang.String of variable name |
2 | Type java.util.ArrayList<org.eclipse.emf.ecore.EClassifier> of variable superTypes does not match with type java.util.List<java.lang.String> of variable names |
3 | Unmatched statement EPackage otherESubpackage=eSubpackages.get(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement diagnostics.add(createDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,UNIQUE_SUBPACKAGE_NAMES,"_UI_EPackageUniqueSubpackageNames_diagnostic",new Object[]{name},new Object[]{ePackage,eSubpackage,otherESubpackage},context)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement 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)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variables index, result , while Clone fragment #2 returns variables index, result |