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 validateEOperation_UniqueTypeParameterNames(EOperation, DiagnosticChain, Map
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | for (ETypeParameter eTypeParameter : eTypeParameters)↵ | 1 | for (ETypeParameter eTypeParameter : eTypeParameters)↵ | |
2 | {↵ | 2 | {↵ | |
3 | String name = eTypeParameter.getName();↵ | 3 | String name = eTypeParameter.getName();↵ | |
4 | if (name != null)↵ | 4 | if (name != null)↵ | |
5 | {↵ | 5 | {↵ | |
6 | int index = names.indexOf(name);↵ | 6 | int index = names.indexOf(name);↵ | |
7 | if (index != -1)↵ | 7 | if (index != -1)↵ | |
8 | {↵ | 8 | {↵ | |
9 | if (diagnostics == null)↵ | 9 | if (diagnostics == null)↵ | |
10 | {↵ | 10 | {↵ | |
11 | return false;↵ | 11 | return false;↵ | |
12 | }↵ | 12 | }↵ | |
13 | else↵ | 13 | else↵ | |
14 | {↵ | 14 | {↵ | |
15 | result = false;↵ | 15 | result = false;↵ | |
16 | ETypeParameter otherETypeParameter = eTypeParameters.get(index);↵ | 16 | ETypeParameter otherETypeParameter = eTypeParameters.get(index);↵ | |
17 | diagnostics.add↵ | 17 | diagnostics.add↵ | |
18 | (createDiagnostic↵ | 18 | (createDiagnostic↵ | |
19 | (Diagnostic.ERROR,↵ | 19 | (Diagnostic.ERROR,↵ | |
20 | DIAGNOSTIC_SOURCE,↵ | 20 | DIAGNOSTIC_SOURCE,↵ | |
21 | UNIQUE_TYPE_PARAMETER_NAMES,↵ | 21 | UNIQUE_TYPE_PARAMETER_NAMES,↵ | |
22 | "_UI_UniqueTypeParameterNames_diagnostic", ↵ | 22 | "_UI_UniqueTypeParameterNames_diagnostic", ↵ | |
23 | new Object[] { name },↵ | 23 | new Object[] { name },↵ | |
24 | new Object[] { eClassifier, eTypeParameter, otherETypeParameter },↵ | 24 | new Object[] { eOperation, eTypeParameter, otherETypeParameter },↵ | |
25 | context));↵ | 25 | context));↵ | |
26 | }↵ | 26 | }↵ | |
27 | }↵ | 27 | }↵ | |
28 | }↵ | 28 | }↵ | |
29 | names.add(name);↵ | 29 | names.add(name);↵ | |
30 | }↵ | 30 | }↵ | |
31 | return result; | 31 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
Number of mapped statements | 12 |
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) | 4.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (ETypeParameter eTypeParameter : eTypeParameters) | 4 | for (ETypeParameter eTypeParameter : eTypeParameters) | |||||||||||||||
5 | String name = eTypeParameter.getName(); | 5 | String name = eTypeParameter.getName(); | |||||||||||||||
6 | if (name != null) | 6 | if (name != null) | |||||||||||||||
7 | int index = names.indexOf(name); | 7 | int index = names.indexOf(name); | |||||||||||||||
8 | if (index != -1) | 8 | if (index != -1) | |||||||||||||||
9 | if (diagnostics == null) | 9 | if (diagnostics == null) | |||||||||||||||
10 | return false; | 10 | return false; | |||||||||||||||
else | else | |||||||||||||||||
11 | result = false; | 11 | result = false; | |||||||||||||||
12 | ETypeParameter otherETypeParameter = eTypeParameters.get(index); | 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)); |
| 13 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, UNIQUE_TYPE_PARAMETER_NAMES, "_UI_UniqueTypeParameterNames_diagnostic", new Object[] {name}, new Object[] {eOperation, eTypeParameter, otherETypeParameter}, context)); | ||||||||||||||
14 | names.add(name); | 14 | names.add(name); | |||||||||||||||
15 | return result; | 15 | return result; |
Row | Violation |
---|---|
1 | Type org.eclipse.emf.ecore.EClassifier of variable eClassifier does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation |