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 setStatusLineManager(ISelection)
|
Method name: void setStatusLineManager(ISelection)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?↵ | 1 | IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?↵ | |
2 | contentOutlineStatusLineManager : getActionBars().getStatusLineManager();↵ | 2 | contentOutlineStatusLineManager : getActionBars().getStatusLineManager();↵ | |
3 | if (statusLineManager != null)↵ | 3 | if (statusLineManager != null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | if (selection instanceof IStructuredSelection)↵ | 5 | if (selection instanceof IStructuredSelection)↵ | |
6 | {↵ | 6 | {↵ | |
7 | Collection<?> collection = ((IStructuredSelection)selection).toList();↵ | 7 | Collection<?> collection = ((IStructuredSelection)selection).toList();↵ | |
8 | switch (collection.size())↵ | 8 | switch (collection.size())↵ | |
9 | {↵ | 9 | {↵ | |
10 | case 0:↵ | 10 | case 0:↵ | |
11 | {↵ | 11 | {↵ | |
12 | statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$↵ | 12 | statusLineManager.setMessage(getString("_UI_NoObjectSelected"));↵ | |
13 | break;↵ | 13 | break;↵ | |
14 | }↵ | 14 | }↵ | |
15 | case 1:↵ | 15 | case 1:↵ | |
16 | {↵ | 16 | {↵ | |
17 | String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());↵ | 17 | String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());↵ | |
18 | statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$↵ | 18 | statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));↵ | |
19 | break;↵ | 19 | break;↵ | |
20 | }↵ | 20 | }↵ | |
21 | default:↵ | 21 | default:↵ | |
22 | {↵ | 22 | {↵ | |
23 | statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); //$NON-NLS-1$↵ | 23 | statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));↵ | |
24 | break;↵ | 24 | break;↵ | |
25 | }↵ | 25 | }↵ | |
26 | }↵ | 26 | }↵ | |
27 | }↵ | 27 | }↵ | |
28 | else↵ | 28 | else↵ | |
29 | {↵ | 29 | {↵ | |
30 | statusLineManager.setMessage(""); //$NON-NLS-1$↵ | 30 | statusLineManager.setMessage("");↵ | |
31 | }↵ | 31 | }↵ | |
32 | } | 32 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 79 |
Number of mapped statements | 16 |
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) | 3984.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); | 1 | IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); | ||||||||||||||||||||||||
2 | if (statusLineManager != null) | 2 | if (statusLineManager != null) | ||||||||||||||||||||||||
3 | if (selection instanceof IStructuredSelection) | 3 | if (selection instanceof IStructuredSelection) | ||||||||||||||||||||||||
4 | Collection<?> collection = ((IStructuredSelection)selection).toList(); | 4 | Collection<?> collection = ((IStructuredSelection)selection).toList(); | ||||||||||||||||||||||||
5 | switch (collection.size()) |
| 5 | switch (collection.size()) | |||||||||||||||||||||||
6 | case 0: | 6 | case 0: | ||||||||||||||||||||||||
7 | statusLineManager.setMessage(getString("_UI_NoObjectSelected")); | 7 | statusLineManager.setMessage(getString("_UI_NoObjectSelected")); | ||||||||||||||||||||||||
8 | break; | 8 | break; | ||||||||||||||||||||||||
9 | case 1: | 9 | case 1: | ||||||||||||||||||||||||
10 | String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); |
| 10 | String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); | |||||||||||||||||||||||
11 | statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); | 11 | statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); | ||||||||||||||||||||||||
12 | break; | 12 | break; | ||||||||||||||||||||||||
13 | default: | 13 | default: | ||||||||||||||||||||||||
14 | statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); |
| 14 | statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); | |||||||||||||||||||||||
15 | break; | 15 | break; | ||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
16 | statusLineManager.setMessage(""); | 16 | statusLineManager.setMessage(""); |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Expression collection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression collection.iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type of variable collection.iterator().next() does not match with type of variable collection.iterator().next() |
5 | Expression collection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression collection.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type java.util.Iterator<> of variable collection.iterator() does not match with type java.util.Iterator<> of variable collection.iterator() |
8 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
9 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |