File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLEditor.java | |||
Method name: Diagnostic analyzeResourceProblems(Resource, Exception)
|
Method name: Diagnostic analyzeResourceProblems(Resource, Exception)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty())↵ | 1 | if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty())↵ | |
2 | {↵ | 2 | {↵ | |
3 | BasicDiagnostic basicDiagnostic =↵ | 3 | BasicDiagnostic basicDiagnostic =↵ | |
4 | new BasicDiagnostic↵ | 4 | new BasicDiagnostic↵ | |
5 | (Diagnostic.ERROR,↵ | 5 | (Diagnostic.ERROR,↵ | |
6 | "org.eclipse.emf.ecore.editor",↵ | 6 | "org.eclipse.emf.mapping.ecore2xml.edit", //$NON-NLS-1$↵ | |
7 | 0,↵ | 7 | 0,↵ | |
8 | getString("_UI_CreateModelError_message", resource.getURI()),↵ | 8 | getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$↵ | |
9 | new Object [] { exception == null ? (Object)resource : exception });↵ | 9 | new Object [] { exception == null ? (Object)resource : exception });↵ | |
10 | basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));↵ | 10 | basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));↵ | |
11 | return basicDiagnostic;↵ | 11 | return basicDiagnostic;↵ | |
12 | }↵ | 12 | }↵ | |
13 | else if (exception != null)↵ | 13 | else if (exception != null)↵ | |
14 | {↵ | 14 | {↵ | |
15 | return↵ | 15 | return↵ | |
16 | new BasicDiagnostic↵ | 16 | new BasicDiagnostic↵ | |
17 | (Diagnostic.ERROR,↵ | 17 | (Diagnostic.ERROR,↵ | |
18 | "org.eclipse.emf.ecore.editor",↵ | 18 | "org.eclipse.emf.mapping.ecore2xml.edit", //$NON-NLS-1$↵ | |
19 | 0,↵ | 19 | 0,↵ | |
20 | getString("_UI_CreateModelError_message", resource.getURI()),↵ | 20 | getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$↵ | |
21 | new Object[] { exception });↵ | 21 | new Object[] { exception });↵ | |
22 | }↵ | 22 | }↵ | |
23 | else↵ | 23 | else↵ | |
24 | {↵ | 24 | {↵ | |
25 | return Diagnostic.OK_INSTANCE;↵ | 25 | return Diagnostic.OK_INSTANCE;↵ | |
26 | } | 26 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 38 |
Number of mapped statements | 7 |
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) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) | 1 | if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) | |||||||||||
2 | BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.ecore.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception == null ? (Object)resource : exception}); |
| 2 | BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.mapping.ecore2xml.edit", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception == null ? (Object)resource : exception}); | ||||||||||
3 | basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); | 3 | basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); | |||||||||||
4 | return basicDiagnostic; | 4 | return basicDiagnostic; | |||||||||||
5 | else if (exception != null) | 5 | else if (exception != null) | |||||||||||
6 | return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.ecore.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception}); |
| 6 | return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.emf.mapping.ecore2xml.edit", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] {exception}); | ||||||||||
else | else | |||||||||||||
7 | return Diagnostic.OK_INSTANCE; | 7 | return Diagnostic.OK_INSTANCE; |
Row | Violation |
---|