File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java | |||
Method name: Diagnostic computeDiagnostic(Resource, boolean)
|
Method name: Diagnostic computeDiagnostic(Resource, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for (Resource.Diagnostic resourceDiagnostic : resource.getErrors())↵ | 1 | for (Resource.Diagnostic resourceDiagnostic : resource.getWarnings())↵ | |
2 | {↵ | 2 | ↵ | |
3 | {↵ | |||
3 | Diagnostic diagnostic = null;↵ | 4 | Diagnostic diagnostic = null;↵ | |
4 | if (resourceDiagnostic instanceof Throwable)↵ | 5 | if (resourceDiagnostic instanceof Throwable)↵ | |
5 | {↵ | 6 | ↵ | |
7 | {↵ | |||
6 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);↵ | 8 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);↵ | |
7 | }↵ | 9 | }↵ | |
8 | else↵ | 10 | else↵ | |
9 | {↵ | 11 | {↵ | |
10 | diagnostic = new BasicDiagnostic(↵ | 12 | diagnostic = new BasicDiagnostic(↵ | |
11 | Diagnostic.ERROR,↵ | 13 | Diagnostic.WARNING,↵ | |
12 | "org.eclipse.emf.ecore.resource", ↵ | 14 | "org.eclipse.emf.ecore.resource", ↵ | |
13 | 0, ↵ | 15 | 0, ↵ | |
14 | resourceDiagnostic.getMessage(),↵ | 16 | resourceDiagnostic.getMessage(),↵ | |
15 | new Object[]{resourceDiagnostic});↵ | 17 | new Object[]{resourceDiagnostic});↵ | |
16 | }↵ | 18 | ↵ | |
19 | }↵ | |||
17 | basicDiagnostic.add(diagnostic);↵ | 20 | basicDiagnostic.add(diagnostic);↵ | |
18 | } | 21 | } | |
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 19 |
Number of mapped statements | 6 |
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) | 3.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (Resource.Diagnostic resourceDiagnostic : resource.getErrors()) |
| 11 | for (Resource.Diagnostic resourceDiagnostic : resource.getWarnings()) | ||||||||||
5 | Diagnostic diagnostic = null; | 12 | Diagnostic diagnostic = null; | |||||||||||
6 | if (resourceDiagnostic instanceof Throwable) | 13 | if (resourceDiagnostic instanceof Throwable) | |||||||||||
7 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); | 14 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); | |||||||||||
else | else | |||||||||||||
8 | diagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.ecore.resource", 0, resourceDiagnostic.getMessage(), new Object[] {resourceDiagnostic}); |
| 15 | diagnostic = new BasicDiagnostic(Diagnostic.WARNING, "org.eclipse.emf.ecore.resource", 0, resourceDiagnostic.getMessage(), new Object[] {resourceDiagnostic}); | ||||||||||
9 | basicDiagnostic.add(diagnostic); | 16 | basicDiagnostic.add(diagnostic); |
Row | Violation |
---|