From 9c059e69aac1336955e13670943787b680d3f22c Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 11 Nov 2012 22:45:28 +0000 Subject: [PATCH] clean up a few warnings --- app/src/processing/mode/java2/DebugToolbar.java | 16 +++++++++------- app/src/processing/mode/java2/Debugger.java | 13 +++++-------- .../processing/mode/java2/VariableInspector.java | 6 +++--- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/src/processing/mode/java2/DebugToolbar.java b/app/src/processing/mode/java2/DebugToolbar.java index 16bac9054..0dbdc7892 100755 --- a/app/src/processing/mode/java2/DebugToolbar.java +++ b/app/src/processing/mode/java2/DebugToolbar.java @@ -34,16 +34,18 @@ import processing.mode.java.JavaToolbar; * * @author Martin Leopold */ +@SuppressWarnings("hiding") public class DebugToolbar extends JavaToolbar { - // preserve original button id's, but re-define so they are accessible (they are protected) + // preserve original button id's, but re-define so they are accessible + // (they are used by DebugEditor, so they want to be public) - static protected final int RUN = 100; // change this, to be able to get it's name via getTitle() - static protected final int STOP = JavaToolbar.STOP; + static protected final int RUN = 100; // change this, to be able to get it's name via getTitle() + static protected final int STOP = JavaToolbar.STOP; - static protected final int NEW = JavaToolbar.NEW; - static protected final int OPEN = JavaToolbar.OPEN; - static protected final int SAVE = JavaToolbar.SAVE; - static protected final int EXPORT = JavaToolbar.EXPORT; + static protected final int NEW = JavaToolbar.NEW; + static protected final int OPEN = JavaToolbar.OPEN; + static protected final int SAVE = JavaToolbar.SAVE; + static protected final int EXPORT = JavaToolbar.EXPORT; static protected final int DEBUG = JavaToolbar.RUN; static protected final int CONTINUE = 101; diff --git a/app/src/processing/mode/java2/Debugger.java b/app/src/processing/mode/java2/Debugger.java index 5459784a8..e784ee305 100755 --- a/app/src/processing/mode/java2/Debugger.java +++ b/app/src/processing/mode/java2/Debugger.java @@ -19,10 +19,7 @@ package processing.mode.java2; import com.sun.jdi.*; import com.sun.jdi.event.*; -import com.sun.jdi.request.BreakpointRequest; -import com.sun.jdi.request.ClassPrepareRequest; -import com.sun.jdi.request.EventRequestManager; -import com.sun.jdi.request.StepRequest; +import com.sun.jdi.request.*; import java.io.*; import java.util.ArrayList; import java.util.HashMap; @@ -534,7 +531,7 @@ public class Debugger implements VMEventListener { Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "*** VM Event: {0}", e.toString()); if (e instanceof VMStartEvent) { //initialThread = ((VMStartEvent) e).thread(); - ThreadReference t = ((VMStartEvent) e).thread(); +// ThreadReference t = ((VMStartEvent) e).thread(); //printStackTrace(t); // break on main class load @@ -582,7 +579,7 @@ public class Debugger implements VMEventListener { } else if (e instanceof BreakpointEvent) { BreakpointEvent be = (BreakpointEvent) e; currentThread = be.thread(); // save this thread - BreakpointRequest br = (BreakpointRequest) be.request(); +// BreakpointRequest br = (BreakpointRequest) be.request(); //printSourceLocation(currentThread); updateVariableInspector(currentThread); // this is already on the EDT @@ -730,7 +727,7 @@ public class Debugger implements VMEventListener { System.out.println("stack trace for thread " + t.name() + ":"); int i = 0; for (StackFrame f : t.frames()) { - Location l = f.location(); +// Location l = f.location(); System.out.println(i++ + ": " + f.toString()); } } catch (IncompatibleThreadStateException ex) { @@ -1078,7 +1075,7 @@ public class Debugger implements VMEventListener { protected List getStackTrace(ThreadReference t) { List stack = new ArrayList(); try { - int i = 0; +// int i = 0; for (StackFrame f : t.frames()) { stack.add(new DefaultMutableTreeNode(locationToString(f.location()))); } diff --git a/app/src/processing/mode/java2/VariableInspector.java b/app/src/processing/mode/java2/VariableInspector.java index ea53ea807..14c508861 100755 --- a/app/src/processing/mode/java2/VariableInspector.java +++ b/app/src/processing/mode/java2/VariableInspector.java @@ -41,7 +41,6 @@ import javax.swing.UIManager; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; import javax.swing.table.TableColumn; -import javax.swing.tree.AbstractLayoutCache; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.ExpandVetoException; @@ -359,8 +358,8 @@ public class VariableInspector extends javax.swing.JFrame { } } else { if (o instanceof TreeNode) { - TreeNode node = (TreeNode) o; - AbstractLayoutCache layout = tree.getLayoutCache(); +// TreeNode node = (TreeNode) o; +// AbstractLayoutCache layout = tree.getLayoutCache(); UIDefaults defaults = UIManager.getDefaults(); boolean isLeaf = model.isLeaf(o); @@ -896,6 +895,7 @@ public class VariableInspector extends javax.swing.JFrame { * Prefix a this-fields name with "this." if hidden by a local. */ public static final int MODE_PREFIX = 1; // prefix hidden this fields with "this." + @SuppressWarnings("hiding") protected List locals; protected int mode;