File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/action/DelegatingCommandAction.java | File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/action/DelegatingCommandAction.java | |||
Method name: void unregisterSelectionListener(IWorkbenchPart)
|
Method name: void registerSelectionListener(IWorkbenchPart)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider();↵ | 1 | ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider();↵ | |
2 | if (selectionProvider != null) ↵ | 2 | if (selectionProvider != null) ↵ | |
3 | {↵ | 3 | {↵ | |
4 | selectionProvider.removeSelectionChangedListener(this);↵ | 4 | selectionProvider.addSelectionChangedListener(this);↵ | |
5 | handleSelection(selectionProvider.getSelection());↵ | |||
5 | } | 6 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider(); | 1 | ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider(); | |||||||||||||||
2 | if (selectionProvider != null) | 2 | if (selectionProvider != null) | |||||||||||||||
3 | selectionProvider.removeSelectionChangedListener(this); |
| 3 | selectionProvider.addSelectionChangedListener(this); | ||||||||||||||
|
| 4 | handleSelection(selectionProvider.getSelection()); |
Row | Violation |
---|---|
1 | Expression selectionProvider.removeSelectionChangedListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression selectionProvider.addSelectionChangedListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression selectionProvider.removeSelectionChangedListener(this) is a void method call, and thus it cannot be parameterized |
4 | Expression selectionProvider.addSelectionChangedListener(this) is a void method call, and thus it cannot be parameterized |
5 | Unmatched statement handleSelection(selectionProvider.getSelection()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables selectionProvider |