File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLEditor.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java | |||
Method name: void updateProblemIndication()
|
Method name: void updateProblemIndication()
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | if (updateProblemIndication)↵ | 1 | if (updateProblemIndication)↵ | |
2 | {↵ | 2 | {↵ | |
3 | BasicDiagnostic diagnostic =↵ | 3 | BasicDiagnostic diagnostic =↵ | |
4 | new BasicDiagnostic↵ | 4 | new BasicDiagnostic↵ | |
5 | (Diagnostic.OK,↵ | 5 | (Diagnostic.OK,↵ | |
6 | "org.eclipse.emf.mapping.ecore2xml.edit", //$NON-NLS-1$↵ | 6 | "org.eclipse.emf.ecore.editor",↵ | |
7 | 0,↵ | 7 | 0,↵ | |
8 | null,↵ | 8 | null,↵ | |
9 | new Object [] { editingDomain.getResourceSet() });↵ | 9 | new Object [] { editingDomain.getResourceSet() });↵ | |
10 | for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values())↵ | 10 | for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values())↵ | |
11 | {↵ | 11 | {↵ | |
12 | if (childDiagnostic.getSeverity() != Diagnostic.OK)↵ | 12 | if (childDiagnostic.getSeverity() != Diagnostic.OK)↵ | |
13 | {↵ | 13 | {↵ | |
14 | diagnostic.add(childDiagnostic);↵ | 14 | diagnostic.add(childDiagnostic);↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | int lastEditorPage = getPageCount() - 1;↵ | 17 | int lastEditorPage = getPageCount() - 1;↵ | |
18 | if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart)↵ | 18 | if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart)↵ | |
19 | {↵ | 19 | {↵ | |
20 | ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);↵ | 20 | ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);↵ | |
21 | if (diagnostic.getSeverity() != Diagnostic.OK)↵ | 21 | if (diagnostic.getSeverity() != Diagnostic.OK)↵ | |
22 | {↵ | 22 | {↵ | |
23 | setActivePage(lastEditorPage);↵ | 23 | setActivePage(lastEditorPage);↵ | |
24 | }↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | else if (diagnostic.getSeverity() != Diagnostic.OK)↵ | 26 | else if (diagnostic.getSeverity() != Diagnostic.OK)↵ | |
27 | {↵ | 27 | {↵ | |
28 | ProblemEditorPart problemEditorPart = new ProblemEditorPart();↵ | 28 | ProblemEditorPart problemEditorPart = new ProblemEditorPart();↵ | |
29 | problemEditorPart.setDiagnostic(diagnostic);↵ | 29 | problemEditorPart.setDiagnostic(diagnostic);↵ | |
30 | problemEditorPart.setMarkerHelper(markerHelper);↵ | 30 | problemEditorPart.setMarkerHelper(markerHelper);↵ | |
31 | try↵ | 31 | try↵ | |
32 | {↵ | 32 | {↵ | |
33 | addPage(++lastEditorPage, problemEditorPart, getEditorInput());↵ | 33 | addPage(++lastEditorPage, problemEditorPart, getEditorInput());↵ | |
34 | setPageText(lastEditorPage, problemEditorPart.getPartName());↵ | 34 | setPageText(lastEditorPage, problemEditorPart.getPartName());↵ | |
35 | setActivePage(lastEditorPage);↵ | 35 | setActivePage(lastEditorPage);↵ | |
36 | showTabs();↵ | 36 | showTabs();↵ | |
37 | }↵ | 37 | }↵ | |
38 | catch (PartInitException exception)↵ | 38 | catch (PartInitException exception)↵ | |
39 | {↵ | 39 | {↵ | |
40 | Ecore2XMLUIPlugin.INSTANCE.log(exception);↵ | 40 | EcoreEditorPlugin.INSTANCE.log(exception);↵ | |
41 | }↵ | 41 | }↵ | |
42 | }↵ | 42 | }↵ | |
43 | if (markerHelper.hasMarkers(editingDomain.getResourceSet()))↵ | 43 | if (markerHelper.hasMarkers(editingDomain.getResourceSet()))↵ | |
44 | {↵ | 44 | {↵ | |
45 | markerHelper.deleteMarkers(editingDomain.getResourceSet());↵ | 45 | markerHelper.deleteMarkers(editingDomain.getResourceSet());↵ | |
46 | if (diagnostic.getSeverity() != Diagnostic.OK)↵ | 46 | if (diagnostic.getSeverity() != Diagnostic.OK)↵ | |
47 | {↵ | 47 | {↵ | |
48 | try↵ | 48 | try↵ | |
49 | {↵ | 49 | {↵ | |
50 | markerHelper.createMarkers(diagnostic);↵ | 50 | markerHelper.createMarkers(diagnostic);↵ | |
51 | }↵ | 51 | }↵ | |
52 | catch (CoreException exception)↵ | 52 | catch (CoreException exception)↵ | |
53 | {↵ | 53 | {↵ | |
54 | Ecore2XMLUIPlugin.INSTANCE.log(exception);↵ | 54 | EcoreEditorPlugin.INSTANCE.log(exception);↵ | |
55 | }↵ | 55 | }↵ | |
56 | }↵ | 56 | }↵ | |
57 | }↵ | 57 | }↵ | |
58 | } | 58 |
| |
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) | 3.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 113 |
Number of mapped statements | 24 |
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) | 12.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (updateProblemIndication) | 1 | if (updateProblemIndication) | |||||||||||
2 | BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.emf.mapping.ecore2xml.edit", 0, null, new Object[] {editingDomain.getResourceSet()}); |
| 2 | BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.emf.ecore.editor", 0, null, new Object[] {editingDomain.getResourceSet()}); | ||||||||||
3 | for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) | 3 | for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) | |||||||||||
4 | if (childDiagnostic.getSeverity() != Diagnostic.OK) | 4 | if (childDiagnostic.getSeverity() != Diagnostic.OK) | |||||||||||
5 | diagnostic.add(childDiagnostic); | 5 | diagnostic.add(childDiagnostic); | |||||||||||
6 | int lastEditorPage = getPageCount() - 1; | 6 | int lastEditorPage = getPageCount() - 1; | |||||||||||
7 | if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) | 7 | if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) | |||||||||||
8 | ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic); | 8 | ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic); | |||||||||||
9 | if (diagnostic.getSeverity() != Diagnostic.OK) | 9 | if (diagnostic.getSeverity() != Diagnostic.OK) | |||||||||||
10 | setActivePage(lastEditorPage); | 10 | setActivePage(lastEditorPage); | |||||||||||
11 | else if (diagnostic.getSeverity() != Diagnostic.OK) | 11 | else if (diagnostic.getSeverity() != Diagnostic.OK) | |||||||||||
12 | ProblemEditorPart problemEditorPart = new ProblemEditorPart(); | 12 | ProblemEditorPart problemEditorPart = new ProblemEditorPart(); | |||||||||||
13 | problemEditorPart.setDiagnostic(diagnostic); | 13 | problemEditorPart.setDiagnostic(diagnostic); | |||||||||||
14 | problemEditorPart.setMarkerHelper(markerHelper); | 14 | problemEditorPart.setMarkerHelper(markerHelper); | |||||||||||
15 | try |
| 15 | try | ||||||||||
16 | addPage(++lastEditorPage, problemEditorPart, getEditorInput()); | 16 | addPage(++lastEditorPage, problemEditorPart, getEditorInput()); | |||||||||||
17 | setPageText(lastEditorPage, problemEditorPart.getPartName()); | 17 | setPageText(lastEditorPage, problemEditorPart.getPartName()); | |||||||||||
18 | setActivePage(lastEditorPage); | 18 | setActivePage(lastEditorPage); | |||||||||||
19 | showTabs(); | 19 | showTabs(); | |||||||||||
20 | if (markerHelper.hasMarkers(editingDomain.getResourceSet())) | 20 | if (markerHelper.hasMarkers(editingDomain.getResourceSet())) | |||||||||||
21 | markerHelper.deleteMarkers(editingDomain.getResourceSet()); | 21 | markerHelper.deleteMarkers(editingDomain.getResourceSet()); | |||||||||||
22 | if (diagnostic.getSeverity() != Diagnostic.OK) | 22 | if (diagnostic.getSeverity() != Diagnostic.OK) | |||||||||||
23 | try |
| 23 | try | ||||||||||
24 | markerHelper.createMarkers(diagnostic); | 24 | markerHelper.createMarkers(diagnostic); |
Row | Violation |
---|