From 05b66536a2029e0c6a6aa11ffdf7ea5a58d0b243 Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Sun, 8 Nov 2015 19:38:33 +0100 Subject: [PATCH] Code styling --- java/src/processing/mode/java/Debugger.java | 26 +++++++++------------ 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/java/src/processing/mode/java/Debugger.java b/java/src/processing/mode/java/Debugger.java index 45d6ffc7a..ae146f20c 100644 --- a/java/src/processing/mode/java/Debugger.java +++ b/java/src/processing/mode/java/Debugger.java @@ -22,7 +22,6 @@ package processing.mode.java; import com.sun.jdi.*; import com.sun.jdi.event.*; -import com.sun.jdi.event.Event; import com.sun.jdi.request.*; import java.io.*; @@ -72,28 +71,25 @@ public class Debugger implements VMEventListener { protected ReferenceType mainClass; /// holds all loaded classes in the debuggee VM - protected Set classes = new HashSet(); + protected Set classes = new HashSet<>(); /// listeners for class load events - protected List classLoadListeners = - new ArrayList(); + protected List classLoadListeners = new ArrayList<>(); /// path to the src folder of the current build protected String srcPath; /// list of current breakpoints - protected List breakpoints = - new ArrayList(); + protected List breakpoints = new ArrayList<>(); /// the step request we are currently in, or null if not in a step protected StepRequest requestedStep; /// maps line number changes at runtime (orig -> changed) - protected Map runtimeLineChanges = - new HashMap(); + protected Map runtimeLineChanges = new HashMap<>(); /// tab filenames which already have been tracked for runtime changes - protected Set runtimeTabsTracked = new HashSet(); + protected Set runtimeTabsTracked = new HashSet<>(); public Debugger(JavaEditor editor) { @@ -521,7 +517,7 @@ public class Debugger implements VMEventListener { * @return the list of breakpoints in the given tab */ synchronized List getBreakpoints(String tabFilename) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (LineBreakpoint bp : breakpoints) { if (bp.lineID().fileName().equals(tabFilename)) { list.add(bp); @@ -973,7 +969,7 @@ public class Debugger implements VMEventListener { */ protected List getLocals(ThreadReference t, int depth) { //System.out.println("getting locals"); - List vars = new ArrayList(); + List vars = new ArrayList<>(); try { if (t.frameCount() > 0) { StackFrame sf = t.frame(0); @@ -1015,7 +1011,7 @@ public class Debugger implements VMEventListener { } catch (IncompatibleThreadStateException ex) { log(Level.SEVERE, null, ex); } - return new ArrayList(); + return new ArrayList<>(); } @@ -1030,7 +1026,7 @@ public class Debugger implements VMEventListener { protected List getFields(Value value, int depth, int maxDepth, boolean includeInherited) { // remember: Value <- ObjectReference, ArrayReference - List vars = new ArrayList(); + List vars = new ArrayList<>(); if (depth <= maxDepth) { if (value instanceof ArrayReference) { return getArrayFields((ArrayReference) value); @@ -1072,7 +1068,7 @@ public class Debugger implements VMEventListener { * @return list of array fields */ protected List getArrayFields(ArrayReference array) { - List fields = new ArrayList(); + List fields = new ArrayList<>(); if (array != null) { String arrayType = array.type().name(); if (arrayType.endsWith("[]")) { @@ -1096,7 +1092,7 @@ public class Debugger implements VMEventListener { * @return call stack as list of {@link DefaultMutableTreeNode}s */ protected List getStackTrace(ThreadReference t) { - List stack = new ArrayList(); + List stack = new ArrayList<>(); try { for (StackFrame f : t.frames()) { stack.add(new DefaultMutableTreeNode(locationToString(f.location())));