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 setSelectionToViewer(Collection>)
|
Method name: void setSelectionToViewer(Collection>)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | final Collection<?> theSelection = collection;↵ | 1 | final Collection<?> theSelection = collection;↵ | |
2 | // Make sure it's okay.↵ | 2 | // Make sure it's okay.↵ | |
3 | //↵ | 3 | //↵ | |
4 | if (theSelection != null && !theSelection.isEmpty())↵ | 4 | if (theSelection != null && !theSelection.isEmpty())↵ | |
5 | {↵ | 5 | {↵ | |
6 | // I don't know if this should be run this deferred↵ | 6 | // I don't know if this should be run this deferred↵ | |
7 | // because we might have to give the editor a chance to process the viewer update events↵ | 7 | // because we might have to give the editor a chance to process the viewer update events↵ | |
8 | // and hence to update the views first.↵ | 8 | // and hence to update the views first.↵ | |
9 | //↵ | 9 | //↵ | |
10 | //↵ | 10 | //↵ | |
11 | Runnable runnable =↵ | 11 | Runnable runnable =↵ | |
12 | new Runnable()↵ | 12 | new Runnable()↵ | |
13 | {↵ | 13 | {↵ | |
14 | public void run()↵ | 14 | public void run()↵ | |
15 | {↵ | 15 | {↵ | |
16 | // Try to select the items in the current content viewer of the editor.↵ | 16 | // Try to select the items in the current content viewer of the editor.↵ | |
17 | //↵ | 17 | //↵ | |
18 | if (currentViewer != null)↵ | 18 | if (currentViewer != null)↵ | |
19 | {↵ | 19 | {↵ | |
20 | currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);↵ | 20 | currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);↵ | |
21 | }↵ | 21 | }↵ | |
22 | }↵ | 22 | }↵ | |
23 | };↵ | 23 | };↵ | |
24 | runnable.run();↵ | 24 | runnable.run();↵ | |
25 | } | 25 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | final Collection<?> theSelection = collection; | |||||||||||||||||
1 | final Collection<?> theSelection = collection; | | |||||||||||||||||
2 | if (theSelection != null && !theSelection.isEmpty()) |
| 2 | if (theSelection != null && !theSelection.isEmpty()) | |||||||||||||||
3 | Runnable runnable = new Runnable() {...}; |
| 3 | Runnable runnable = new Runnable() {...}; | |||||||||||||||
4 | runnable.run(); | 4 | runnable.run(); |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable theSelection does not match with type java.util.Collection<> of variable theSelection |
2 | Type java.util.Collection<> of variable theSelection does not match with type java.util.Collection<> of variable theSelection |
3 | Type java.util.Collection<> of variable theSelection does not match with type java.util.Collection<> of variable theSelection |