File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2ecore/action/MapToEcoreActionDelegate.java | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/action/GenerateEcore2XMLActionDelegate.java | |||
Method name: void execute(IProgressMonitor)
|
Method name: void execute(IProgressMonitor)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | try↵ | 1 | try↵ | |
2 | {↵ | 2 | {↵ | |
3 | mappingResource.save(null);↵ | 3 | ecore2xmlResource.save(null);↵ | |
4 | ↵ | 4 | ↵ | |
5 | ↵ | |||
6 | IFile file = getFile(mappingResource);↵ | 5 | IFile file = getFile(ecore2xmlResource);↵ | |
7 | IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();↵ | 6 | IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();↵ | |
8 | ↵ | 7 | ↵ | |
9 | ↵ | |||
10 | final IWorkbenchPart activePart = workbenchPage.getActivePart();↵ | 8 | final IWorkbenchPart activePart = workbenchPage.getActivePart();↵ | |
11 | if (activePart instanceof ISetSelectionTarget)↵ | 9 | if (activePart instanceof ISetSelectionTarget)↵ | |
12 | {↵ | 10 | {↵ | |
13 | final ISelection targetSelection = new StructuredSelection(file);↵ | 11 | final ISelection targetSelection = new StructuredSelection(file);↵ | |
14 | workbenchWindow.getShell().getDisplay().asyncExec(new Runnable()↵ | 12 | workbenchWindow.getShell().getDisplay().asyncExec(new Runnable()↵ | |
15 | {↵ | 13 | {↵ | |
16 | public void run()↵ | 14 | public void run()↵ | |
17 | {↵ | 15 | ↵ | |
18 | ↵ | 16 | {↵ | |
19 | ((ISetSelectionTarget)activePart).selectReveal(targetSelection);↵ | 17 | ((ISetSelectionTarget)activePart).selectReveal(targetSelection);↵ | |
20 | ↵ | 18 | }↵ | |
21 | }↵ | 19 | ↵ | |
22 | });↵ | 20 | });↵ | |
23 | ↵ | 21 | }↵ | |
24 | }↵ | 22 | ↵ | |
25 | ↵ | 23 | ↵ | |
26 | try {↵ | 24 | try {↵ | |
27 | workbenchPage.openEditor(new FileEditorInput(file), workbenchWindow.getWorkbench().getEditorRegistry().getDefaultEditor(file.getFullPath().toString()).getId()); ↵ | 25 | workbenchPage.openEditor(new FileEditorInput(file), workbenchWindow.getWorkbench().getEditorRegistry().getDefaultEditor(file.getFullPath().toString()).getId()); ↵ | |
28 | } catch (PartInitException pie) {↵ | 26 | } catch (PartInitException pie) {↵ | |
29 | Ecore2EcoreEditorPlugin.INSTANCE.log(pie); ↵ | 27 | Ecore2XMLUIPlugin.INSTANCE.log(pie); ↵ | |
30 | }↵ | 28 | ↵ | |
31 | ↵ | 29 | }↵ | |
32 | }↵ | 30 | }↵ | |
33 | catch (IOException ioe)↵ | 31 | catch (IOException ioe)↵ | |
34 | {↵ | 32 | ↵ | |
35 | ↵ | 33 | {↵ | |
36 | Ecore2EcoreEditorPlugin.INSTANCE.log(ioe);↵ | 34 | Ecore2XMLUIPlugin.INSTANCE.log(ioe);↵ | |
37 | ↵ | 35 | ↵ | |
38 | } | 36 |
| |
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 | 46 |
Number of mapped statements | 10 |
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.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | try |
| 9 | try | |||||||||||||||||||
12 | mappingResource.save(null); |
| 10 | ecore2xmlResource.save(null); | |||||||||||||||||||
13 | IFile file = getFile(mappingResource); |
| 11 | IFile file = getFile(ecore2xmlResource); | |||||||||||||||||||
14 | IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); | 12 | IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); | ||||||||||||||||||||
15 | final IWorkbenchPart activePart = workbenchPage.getActivePart(); | 13 | final IWorkbenchPart activePart = workbenchPage.getActivePart(); | ||||||||||||||||||||
16 | if (activePart instanceof ISetSelectionTarget) | 14 | if (activePart instanceof ISetSelectionTarget) | ||||||||||||||||||||
17 | final ISelection targetSelection = new StructuredSelection(file); | 15 | final ISelection targetSelection = new StructuredSelection(file); | ||||||||||||||||||||
18 | workbenchWindow.getShell().getDisplay().asyncExec(new Runnable() {...}); | 16 | workbenchWindow.getShell().getDisplay().asyncExec(new Runnable() {...}); | ||||||||||||||||||||
19 | try |
| 17 | try | |||||||||||||||||||
20 | workbenchPage.openEditor(new FileEditorInput(file), workbenchWindow.getWorkbench().getEditorRegistry().getDefaultEditor(file.getFullPath().toString()).getId()); | 18 | workbenchPage.openEditor(new FileEditorInput(file), workbenchWindow.getWorkbench().getEditorRegistry().getDefaultEditor(file.getFullPath().toString()).getId()); |
Row | Violation |
---|