Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/perf
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-05-19 07:07:13 +0000
committerAlexander Kurtakov2017-05-19 08:42:08 +0000
commitbcaae52874672d24ee39738e02b1236711673f8d (patch)
tree2e5d331300072bc87244fbe55ea7221afd6e7be6 /perf
parent8723f076b325d0dc7b0d9b71c02f04e2a5e551ff (diff)
downloadorg.eclipse.linuxtools-bcaae52874672d24ee39738e02b1236711673f8d.tar.gz
org.eclipse.linuxtools-bcaae52874672d24ee39738e02b1236711673f8d.tar.xz
org.eclipse.linuxtools-bcaae52874672d24ee39738e02b1236711673f8d.zip
Make use IStructuredSelection directly.
Request the structured selection directly instead of getting the selection and checking whether it's instance of IStructuredSelection or just blindly cast. Change-Id: Id1b3b7a2e0398b83fa5a736fcbc484f81c14183a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/97513 Tested-by: Hudson CI
Diffstat (limited to 'perf')
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java
index f712fc8838..45e67b4297 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDoubleClickAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * (C) Copyright 2010 IBM Corp. 2010
+ * (C) Copyright 2010, 2017 IBM Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.internal.perf.PerfPlugin;
@@ -39,8 +38,8 @@ public class PerfDoubleClickAction extends Action {
}
@Override
public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
+ IStructuredSelection selection = viewer.getStructuredSelection();
+ Object obj = selection.getFirstElement();
try {
if (obj instanceof PMLineRef) {

Back to the top