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 validateEClassifier_UniqueTypeParameterNames(EClassifier, DiagnosticChain, Map
|
Method name: boolean validateEClass_ConsistentSuperTypes(EClass, DiagnosticChain, Map
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | int index = names.indexOf(name);↵ | 1 | int index = superTypes.indexOf(eClassifier);↵ | |
2 | if (index != -1)↵ | 2 | if (index != -1)↵ | |
3 | {↵ | 3 | ↵ | |
4 | {↵ | |||
4 | if (diagnostics == null)↵ | 5 | if (diagnostics == null)↵ | |
5 | {↵ | 6 | {↵ | |
6 | return false;↵ | 7 | return false;↵ | |
7 | }↵ | 8 | ↵ | |
9 | }↵ | |||
8 | else↵ | 10 | else↵ | |
9 | {↵ | 11 | {↵ | |
10 | result = false;↵ | 12 | result = false;↵ | |
11 | ETypeParameter otherETypeParameter = eTypeParameters.get(index);↵ | 13 | ↵ | |
12 | diagnostics.add↵ | 14 | diagnostics.add↵ | |
13 | (createDiagnostic↵ | 15 | (createDiagnostic↵ | |
14 | (Diagnostic.ERROR,↵ | 16 | (Diagnostic.ERROR,↵ | |
15 | DIAGNOSTIC_SOURCE,↵ | 17 | DIAGNOSTIC_SOURCE,↵ | |
16 | UNIQUE_TYPE_PARAMETER_NAMES,↵ | 18 | ↵ | |
17 | "_UI_UniqueTypeParameterNam↵ | 19 | CONSISTENT_SUPER_TYPES_CONFLICT,↵ | |
18 | es_diagnostic", ↵ | 20 | "_UI_EClassConsistentSuperTypes_diagnostic",↵ | |
19 | new Object[] { name },↵ | 21 | new Object [] { getObjectLabel(eClassifier, context) },↵ | |
20 | new Object[] { eClassifier, eTypeParameter, otherETypeParameter },↵ | 22 | new Object[] { eClass, eGenericSuperType, eAllGenericSuperTypes.get(index) },↵ | |
21 | context));↵ | 23 | context));↵ | |
22 | }↵ | 24 | ↵ | |
25 | }↵ | |||
23 | } | 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.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 | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | int index = names.indexOf(name); |
| 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 | ETypeParameter otherETypeParameter = eTypeParameters.get(index); |
| | ||||||||||||||||||||||
13 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eClassifier, eTypeParameter, otherETypeParameter}, 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 java.lang.String of variable name does not match with type org.eclipse.emf.ecore.EClassifier of variable eClassifier |
2 | Type java.util.List<java.lang.String> of variable names does not match with type java.util.ArrayList<org.eclipse.emf.ecore.EClassifier> of variable superTypes |
3 | Unmatched statement ETypeParameter otherETypeParameter=eTypeParameters.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_TYPE_PARAMETER_NAMES,"_UI_UniqueTypeParameterNames_diagnostic",new Object[]{name},new Object[]{eClassifier,eTypeParameter,otherETypeParameter},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 |