Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferrazzutti2014-05-02 14:09:19 +0000
committerAlexander Kurtakov2014-05-05 07:27:17 +0000
commit623982979af67709387f831295aa033e6682ebd5 (patch)
tree906e4a13c91a057d622eb8815458ad704c932c85 /systemtap
parentb616bcf890e951f6443b4390187a9dcbc40c04f1 (diff)
downloadorg.eclipse.linuxtools-623982979af67709387f831295aa033e6682ebd5.tar.gz
org.eclipse.linuxtools-623982979af67709387f831295aa033e6682ebd5.tar.xz
org.eclipse.linuxtools-623982979af67709387f831295aa033e6682ebd5.zip
Systemtap: Minor cleanup.
Notably, move (Abstract)ChartMouseMoveListener to public API. Change-Id: I3f1108679c73d28a14ddfd4acdca00f8fa97a45f Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com> Reviewed-on: https://git.eclipse.org/r/25880 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'systemtap')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/internal/systemtap/graphing/core/GraphingCorePlugin.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/FilteredRowDataSet.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/table/FilteredTableDataSet.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/filters/UniqueFilter.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF1
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ToolTipChartMouseMoveListener.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/AbstractChartBuilder.java26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/listeners/AbstractChartMouseMoveListener.java (renamed from systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ChartMouseMoveListener.java)19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/views/GraphSelectorEditorInput.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/GraphFactory.java71
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/IndexedObject.java1
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/Sort.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java8
13 files changed, 83 insertions, 76 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/internal/systemtap/graphing/core/GraphingCorePlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/internal/systemtap/graphing/core/GraphingCorePlugin.java
index 41655d0feb..6430917b6c 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/internal/systemtap/graphing/core/GraphingCorePlugin.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/internal/systemtap/graphing/core/GraphingCorePlugin.java
@@ -18,7 +18,7 @@ import java.util.ArrayList;
public class GraphingCorePlugin {
@SuppressWarnings("unchecked")
- public static <T> ArrayList<T>[] createArrayList(int size, T instance) {
+ public static <T> ArrayList<T>[] createArrayList(int size) {
return new ArrayList[size];
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/FilteredRowDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/FilteredRowDataSet.java
index 4604cafc29..049054363b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/FilteredRowDataSet.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/FilteredRowDataSet.java
@@ -127,7 +127,7 @@ public class FilteredRowDataSet extends RowDataSet implements IFilteredDataSet {
}
private ArrayList<Object>[] getFilterData() {
- ArrayList<Object>[] data = GraphingCorePlugin.createArrayList(original.getColCount(), new Object());
+ ArrayList<Object>[] data = GraphingCorePlugin.createArrayList(original.getColCount());
for(int i=0; i<data.length; i++) {
data[i] = new ArrayList<>();
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/table/FilteredTableDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/table/FilteredTableDataSet.java
index 01390537f2..ca4f4392a5 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/table/FilteredTableDataSet.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/table/FilteredTableDataSet.java
@@ -140,7 +140,7 @@ public class FilteredTableDataSet extends TableDataSet implements IFilteredDataS
}
private ArrayList<Object>[] getFilterData() {
- ArrayList<Object>[] data = GraphingCorePlugin.createArrayList(original.getColCount(), new Object());
+ ArrayList<Object>[] data = GraphingCorePlugin.createArrayList(original.getColCount());
for(int i=0; i<data.length; i++) {
data[i] = new ArrayList<>();
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/filters/UniqueFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/filters/UniqueFilter.java
index 79dc032846..f3c9163788 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/filters/UniqueFilter.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/filters/UniqueFilter.java
@@ -46,7 +46,7 @@ public class UniqueFilter implements IDataSetFilter {
}
List<Object>[] newData = Copier.copy(data);
- ArrayList<Object>[] aggregates = GraphingCorePlugin.createArrayList(newData.length, new Object());
+ ArrayList<Object>[] aggregates = GraphingCorePlugin.createArrayList(newData.length);
for(int i=0; i<aggregates.length;i++) {
aggregates[i] = new ArrayList<>();
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
index 88a0114c49..cfe825b3dc 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
@@ -8,6 +8,7 @@ Bundle-Vendor: %bundleProvider
Bundle-Localization: plugin
Export-Package: org.eclipse.linuxtools.systemtap.graphing.ui,
org.eclipse.linuxtools.systemtap.graphing.ui.charts,
+ org.eclipse.linuxtools.systemtap.graphing.ui.charts.listeners,
org.eclipse.linuxtools.systemtap.graphing.ui.datadisplay,
org.eclipse.linuxtools.systemtap.graphing.ui.views,
org.eclipse.linuxtools.systemtap.graphing.ui.widgets,
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ToolTipChartMouseMoveListener.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ToolTipChartMouseMoveListener.java
index 3df72c91a8..4a76bf6803 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ToolTipChartMouseMoveListener.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ToolTipChartMouseMoveListener.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.linuxtools.internal.systemtap.graphing.ui.charts.listeners;
+import org.eclipse.linuxtools.systemtap.graphing.ui.charts.listeners.AbstractChartMouseMoveListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
@@ -21,7 +22,7 @@ import org.swtchart.Chart;
/**
* @since 3.0
*/
-public class ToolTipChartMouseMoveListener extends ChartMouseMoveListener {
+public class ToolTipChartMouseMoveListener extends AbstractChartMouseMoveListener {
private static final int TIP_OFFSET = 20;
protected final Shell tipShell;
protected final Text tipText;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/AbstractChartBuilder.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/AbstractChartBuilder.java
index 89a2ccf0c5..e41eda4bd1 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/AbstractChartBuilder.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/AbstractChartBuilder.java
@@ -21,9 +21,9 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.linuxtools.internal.systemtap.graphing.ui.GraphingUIPlugin;
-import org.eclipse.linuxtools.internal.systemtap.graphing.ui.charts.listeners.ChartMouseMoveListener;
import org.eclipse.linuxtools.internal.systemtap.graphing.ui.preferences.GraphingPreferenceConstants;
import org.eclipse.linuxtools.systemtap.graphing.core.adapters.IAdapter;
+import org.eclipse.linuxtools.systemtap.graphing.ui.charts.listeners.AbstractChartMouseMoveListener;
import org.eclipse.linuxtools.systemtap.structures.listeners.IUpdateListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -69,17 +69,17 @@ public abstract class AbstractChartBuilder extends Composite implements IUpdateL
protected static final Color RED = Display.getDefault().getSystemColor(SWT.COLOR_RED);
protected static final Color[] COLORS = {
- RED,
- Display.getDefault().getSystemColor(SWT.COLOR_GREEN),
- Display.getDefault().getSystemColor(SWT.COLOR_BLUE),
- Display.getDefault().getSystemColor(SWT.COLOR_YELLOW),
- Display.getDefault().getSystemColor(SWT.COLOR_MAGENTA),
- Display.getDefault().getSystemColor(SWT.COLOR_CYAN),
- BLACK,
- new Color(Display.getDefault(), 64, 128, 128),
- new Color(Display.getDefault(), 255, 165, 0),
- new Color(Display.getDefault(), 128, 128, 128),
- };
+ RED,
+ Display.getDefault().getSystemColor(SWT.COLOR_GREEN),
+ Display.getDefault().getSystemColor(SWT.COLOR_BLUE),
+ Display.getDefault().getSystemColor(SWT.COLOR_YELLOW),
+ Display.getDefault().getSystemColor(SWT.COLOR_MAGENTA),
+ Display.getDefault().getSystemColor(SWT.COLOR_CYAN),
+ BLACK,
+ new Color(Display.getDefault(), 64, 128, 128),
+ new Color(Display.getDefault(), 255, 165, 0),
+ new Color(Display.getDefault(), 128, 128, 128),
+ };
/**
* Chart instance.
*/
@@ -97,7 +97,7 @@ public abstract class AbstractChartBuilder extends Composite implements IUpdateL
* It is null by default.
* @since 3.0
*/
- protected ChartMouseMoveListener chartMouseMoveListener = null;
+ protected AbstractChartMouseMoveListener chartMouseMoveListener = null;
/**
* A reference to the SystemTap Graphing preference store.
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ChartMouseMoveListener.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/listeners/AbstractChartMouseMoveListener.java
index 0e4933f406..818bd54bef 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/internal/systemtap/graphing/ui/charts/listeners/ChartMouseMoveListener.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/charts/listeners/AbstractChartMouseMoveListener.java
@@ -8,7 +8,7 @@
* Contributors:
* Red Hat - Initial API and implementation.
*******************************************************************************/
-package org.eclipse.linuxtools.internal.systemtap.graphing.ui.charts.listeners;
+package org.eclipse.linuxtools.systemtap.graphing.ui.charts.listeners;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
@@ -17,21 +17,24 @@ import org.eclipse.swt.widgets.Composite;
import org.swtchart.Chart;
/**
- * Clients may override this listener class to display data values of the chart as they
- * are hovered over by the mouse.
- * @author aferrazz
+ * An abstract listener class for displaying data values of a chart as it
+ * is hovered over by the mouse.
+ *
+ * Clients must override this class to specify how the listener should react
+ * to different kinds of mouse behaviour.
* @since 3.0
*/
-public abstract class ChartMouseMoveListener implements MouseMoveListener {
+public abstract class AbstractChartMouseMoveListener implements MouseMoveListener {
protected final Chart chart;
protected MouseEvent lastMouseEvent = null;
/**
- * Constructor.
+ * Create a listener to react to mouse movements made in the provided chart region.
* @param chart The chart that this listener is watching.
- * @param hoverArea The plot area of the chart this listener is applied to.
+ * @param hoverArea The plot area of the chart in which this listener will react
+ * to mouse movement.
*/
- public ChartMouseMoveListener(Chart chart, final Composite hoverArea) {
+ public AbstractChartMouseMoveListener(Chart chart, final Composite hoverArea) {
this.chart = chart;
final MouseMoveListener thisListener = this;
hoverArea.addMouseTrackListener(new MouseTrackAdapter() {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/views/GraphSelectorEditorInput.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/views/GraphSelectorEditorInput.java
index 9b78c1a4fa..b121971ee3 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/views/GraphSelectorEditorInput.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/views/GraphSelectorEditorInput.java
@@ -35,7 +35,7 @@ public class GraphSelectorEditorInput implements IEditorInput {
}
@Override
- public Object getAdapter(Class adapter) {
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
return null;
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/GraphFactory.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/GraphFactory.java
index 66038b6916..1f770677a1 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/GraphFactory.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/GraphFactory.java
@@ -112,7 +112,8 @@ public final class GraphFactory {
return null;
}
- public static boolean isMultiGraph(String id) {
+ // TODO leave in id paramter to cover possible future support of more graph types.
+ public static boolean isMultiGraph(@SuppressWarnings("unused") String id) {
return true;
}
@@ -121,40 +122,40 @@ public final class GraphFactory {
AbstractChartBuilder builder = null;
switch (getIndex(gd.graphID)) {
- case 0:
- builder = new ScatterChartBuilder(comp, style, gd.title,
- new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
- gd.ySeries, gd.key));
- break;
- case 1:
- builder = new LineChartBuilder(comp, style, gd.title,
- new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
- gd.ySeries, gd.key));
- break;
- case 2:
- if (!(data instanceof IBlockDataSet) || (null != gd.key)) {
- builder = new BarChartBuilder(comp, style, gd.title,
- new ScrollAdapter((IHistoricalDataSet) data,
- gd.xSeries, gd.ySeries, gd.key));
-
- } else {
- builder = new BarChartBuilder(comp, style, gd.title,
- new BlockAdapter((IBlockDataSet) data, gd.xSeries,
- gd.ySeries));
-
- }
- break;
- case 3:
- builder = new AreaChartBuilder(comp, style, gd.title,
- new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
- gd.ySeries, gd.key));
- break;
- case 4:
- builder = new PieChartBuilder(comp, style, gd.title,
- new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
- gd.ySeries, gd.key));
-
- break;
+ case 0:
+ builder = new ScatterChartBuilder(comp, style, gd.title,
+ new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
+ gd.ySeries, gd.key));
+ break;
+ case 1:
+ builder = new LineChartBuilder(comp, style, gd.title,
+ new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
+ gd.ySeries, gd.key));
+ break;
+ case 2:
+ if (!(data instanceof IBlockDataSet) || (null != gd.key)) {
+ builder = new BarChartBuilder(comp, style, gd.title,
+ new ScrollAdapter((IHistoricalDataSet) data,
+ gd.xSeries, gd.ySeries, gd.key));
+
+ } else {
+ builder = new BarChartBuilder(comp, style, gd.title,
+ new BlockAdapter((IBlockDataSet) data, gd.xSeries,
+ gd.ySeries));
+
+ }
+ break;
+ case 3:
+ builder = new AreaChartBuilder(comp, style, gd.title,
+ new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
+ gd.ySeries, gd.key));
+ break;
+ case 4:
+ builder = new PieChartBuilder(comp, style, gd.title,
+ new ScrollAdapter((IHistoricalDataSet) data, gd.xSeries,
+ gd.ySeries, gd.key));
+
+ break;
}
return builder;
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/IndexedObject.java b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/IndexedObject.java
index daae4081b2..bfc43db75a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/IndexedObject.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/IndexedObject.java
@@ -26,6 +26,7 @@ public class IndexedObject implements Comparable<IndexedObject>{
return val.toString();
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public int compareTo(IndexedObject o) {
if(o != null) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/Sort.java b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/Sort.java
index 8d584fe853..4f38b31c20 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/Sort.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/Sort.java
@@ -21,12 +21,13 @@ public final class Sort {
* @param r Recursed value, initially bottom value.
*/
public static void quicksort(Object[] list, int p, int r) {
- if(null == list)
+ if(null == list) {
return;
- else if (p < r) {
+ } else if (p < r) {
int q = partition(list,p,r);
- if (q == r)
+ if (q == r) {
q--;
+ }
quicksort(list,p,q);
quicksort(list,q+1,r);
@@ -40,30 +41,35 @@ public final class Sort {
* @param p Recursed value, initially top value.
* @param r Recursed value, initially bottom value.
*/
+ @SuppressWarnings({ "unchecked", "rawtypes" })
private static int partition (Object[] list, int p, int r) {
Comparable pivot = (list[p] instanceof Comparable ? (Comparable)list[p] : list[p].toString());
int lo = p;
int hi = r;
while (true) {
- while (getComparable(list[hi]).compareTo(pivot) >= 0 && lo < hi)
+ while (getComparable(list[hi]).compareTo(pivot) >= 0 && lo < hi) {
hi--;
+ }
- while (getComparable(list[lo]).compareTo(pivot) < 0 && lo < hi)
+ while (getComparable(list[lo]).compareTo(pivot) < 0 && lo < hi) {
lo++;
+ }
if (lo < hi) {
Object T = list[lo];
list[lo] = list[hi];
list[hi] = T;
- } else
+ } else {
return hi;
+ }
}
}
+ @SuppressWarnings("rawtypes")
private static Comparable getComparable(Object o) {
return (o instanceof Comparable
? (Comparable)o
- : o.toString());
+ : o.toString());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
index e317b06737..e657fbe3a6 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
@@ -167,7 +167,7 @@ public class RunScriptHandler extends AbstractHandler {
prepareNonLocalScript();
}
final String[] script = buildStandardScript();
- final String[] envVars = getEnvironmentVariables();
+ final String[] envVars = EnvironmentVariablesPreferencePage.getEnvironmentVariables();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
@@ -433,12 +433,6 @@ public class RunScriptHandler extends AbstractHandler {
return dotIndex != -1 ? fileName.substring(0, dotIndex) : fileName;
}
- private String[] getEnvironmentVariables() {
- String[] envVars = EnvironmentVariablesPreferencePage.getEnvironmentVariables();
- // TODO update these with vals? If project is null & PATH not set?
- return envVars;
- }
-
@Override
public boolean isEnabled() {
return (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof STPEditor);

Back to the top