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: void handleChangedResources()
|
Method name: void handleChangedResources()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict()))↵ | 1 | if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict()))↵ | |
2 | {↵ | 2 | {↵ | |
3 | if (isDirty())↵ | 3 | if (isDirty())↵ | |
4 | {↵ | 4 | {↵ | |
5 | changedResources.addAll(editingDomain.getResourceSet().getResources());↵ | 5 | changedResources.addAll(editingDomain.getResourceSet().getResources());↵ | |
6 | }↵ | 6 | }↵ | |
7 | editingDomain.getCommandStack().flush();↵ | 7 | editingDomain.getCommandStack().flush();↵ | |
8 | updateProblemIndication = false;↵ | 8 | updateProblemIndication = false;↵ | |
9 | for (Resource resource : changedResources)↵ | 9 | for (Resource resource : changedResources)↵ | |
10 | {↵ | 10 | {↵ | |
11 | if (resource.isLoaded())↵ | 11 | if (resource.isLoaded())↵ | |
12 | {↵ | 12 | {↵ | |
13 | resource.unload();↵ | 13 | resource.unload();↵ | |
14 | try↵ | 14 | try↵ | |
15 | {↵ | 15 | {↵ | |
16 | resource.load(Collections.EMPTY_MAP);↵ | 16 | resource.load(Collections.EMPTY_MAP);↵ | |
17 | }↵ | 17 | }↵ | |
18 | catch (IOException exception)↵ | 18 | catch (IOException exception)↵ | |
19 | {↵ | 19 | {↵ | |
20 | if (!resourceToDiagnosticMap.containsKey(resource))↵ | 20 | if (!resourceToDiagnosticMap.containsKey(resource))↵ | |
21 | {↵ | 21 | {↵ | |
22 | resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));↵ | 22 | resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));↵ | |
23 | }↵ | 23 | }↵ | |
24 | }↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | }↵ | 26 | }↵ | |
27 | if (AdapterFactoryEditingDomain.isStale(editorSelection))↵ | 27 | if (AdapterFactoryEditingDomain.isStale(editorSelection))↵ | |
28 | {↵ | 28 | {↵ | |
29 | setSelection(StructuredSelection.EMPTY);↵ | 29 | setSelection(StructuredSelection.EMPTY);↵ | |
30 | }↵ | 30 | }↵ | |
31 | updateProblemIndication = true;↵ | 31 | updateProblemIndication = true;↵ | |
32 | updateProblemIndication();↵ | 32 | updateProblemIndication();↵ | |
33 | } | 33 |
| |
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) | 1.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 47 |
Number of mapped statements | 14 |
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) | 6.0 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) | 1 | if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) | |
2 | if (isDirty()) | 2 | if (isDirty()) | |
3 | changedResources.addAll(editingDomain.getResourceSet().getResources()); | 3 | changedResources.addAll(editingDomain.getResourceSet().getResources()); | |
4 | editingDomain.getCommandStack().flush(); | 4 | editingDomain.getCommandStack().flush(); | |
5 | updateProblemIndication = false; | 5 | updateProblemIndication = false; | |
6 | for (Resource resource : changedResources) | 6 | for (Resource resource : changedResources) | |
7 | if (resource.isLoaded()) | 7 | if (resource.isLoaded()) | |
8 | resource.unload(); | 8 | resource.unload(); | |
9 | try | 9 | try | |
10 | resource.load(Collections.EMPTY_MAP); | 10 | resource.load(Collections.EMPTY_MAP); | |
11 | if (AdapterFactoryEditingDomain.isStale(editorSelection)) | 11 | if (AdapterFactoryEditingDomain.isStale(editorSelection)) | |
12 | setSelection(StructuredSelection.EMPTY); | 12 | setSelection(StructuredSelection.EMPTY); | |
13 | updateProblemIndication = true; | 13 | updateProblemIndication = true; | |
14 | updateProblemIndication(); | 14 | updateProblemIndication(); |
Row | Violation |
---|