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: 5 | Number of AST nodes: 5 | |||
1 | Diagnostic diagnostic = null;↵ | 1 | Diagnostic diagnostic = null;↵ | |
2 | if (resourceDiagnostic instanceof Throwable)↵ | 2 | if (resourceDiagnostic instanceof Throwable)↵ | |
3 | {↵ | 3 | ↵ | |
4 | ↵ | 4 | {↵ | |
5 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);↵ | 5 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);↵ | |
6 | }↵ | 6 | ↵ | |
7 | ↵ | 7 | }↵ | |
8 | else↵ | 8 | else↵ | |
9 | {↵ | 9 | ↵ | |
10 | ↵ | 10 | {↵ | |
11 | diagnostic = new BasicDiagnostic(↵ | 11 | diagnostic = new BasicDiagnostic(↵ | |
12 | Diagnostic.WARNING,↵ | 12 | Diagnostic.↵ | |
13 | ↵ | 13 | ERROR,↵ | |
14 | "org.eclipse.emf.ecore.resource", ↵ | 14 | "org.eclipse.emf.ecore.resource", ↵ | |
15 | 0, ↵ | 15 | 0, ↵ | |
16 | resourceDiagnostic.getMessage(),↵ | 16 | resourceDiagnostic.getMessage(),↵ | |
17 | new Object[]{resourceDiagnostic});↵ | 17 | new Object[]{resourceDiagnostic});↵ | |
18 | }↵ | 18 | ↵ | |
19 | ↵ | 19 | }↵ | |
20 | basicDiagnostic.add(diagnostic); | 20 |
| |
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 | 15 |
Number of mapped statements | 5 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12 | Diagnostic diagnostic = null; | 5 | Diagnostic diagnostic = null; | |||||||||||
13 | if (resourceDiagnostic instanceof Throwable) | 6 | if (resourceDiagnostic instanceof Throwable) | |||||||||||
14 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); | 7 | diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); | |||||||||||
else | else | |||||||||||||
15 | diagnostic = new BasicDiagnostic(Diagnostic.WARNING, "org.eclipse.emf.ecore.resource", 0, resourceDiagnostic.getMessage(), new Object[] {resourceDiagnostic}); |
| 8 | diagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.ecore.resource", 0, resourceDiagnostic.getMessage(), new Object[] {resourceDiagnostic}); | ||||||||||
16 | basicDiagnostic.add(diagnostic); | 9 | basicDiagnostic.add(diagnostic); |
Row | Violation |
---|