Skip to content

Commit dc23845

Browse files
committed
Code styling
1 parent d8e179c commit dc23845

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

java/src/processing/mode/java/Debugger.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import com.sun.jdi.*;
2424
import com.sun.jdi.event.*;
25-
import com.sun.jdi.event.Event;
2625
import com.sun.jdi.request.*;
2726

2827
import java.io.*;
@@ -72,28 +71,25 @@ public class Debugger implements VMEventListener {
7271
protected ReferenceType mainClass;
7372

7473
/// holds all loaded classes in the debuggee VM
75-
protected Set<ReferenceType> classes = new HashSet<ReferenceType>();
74+
protected Set<ReferenceType> classes = new HashSet<>();
7675

7776
/// listeners for class load events
78-
protected List<ClassLoadListener> classLoadListeners =
79-
new ArrayList<ClassLoadListener>();
77+
protected List<ClassLoadListener> classLoadListeners = new ArrayList<>();
8078

8179
/// path to the src folder of the current build
8280
protected String srcPath;
8381

8482
/// list of current breakpoints
85-
protected List<LineBreakpoint> breakpoints =
86-
new ArrayList<LineBreakpoint>();
83+
protected List<LineBreakpoint> breakpoints = new ArrayList<>();
8784

8885
/// the step request we are currently in, or null if not in a step
8986
protected StepRequest requestedStep;
9087

9188
/// maps line number changes at runtime (orig -> changed)
92-
protected Map<LineID, LineID> runtimeLineChanges =
93-
new HashMap<LineID, LineID>();
89+
protected Map<LineID, LineID> runtimeLineChanges = new HashMap<>();
9490

9591
/// tab filenames which already have been tracked for runtime changes
96-
protected Set<String> runtimeTabsTracked = new HashSet<String>();
92+
protected Set<String> runtimeTabsTracked = new HashSet<>();
9793

9894

9995
public Debugger(JavaEditor editor) {
@@ -521,7 +517,7 @@ protected boolean hasBreakpoint(LineID line) {
521517
* @return the list of breakpoints in the given tab
522518
*/
523519
synchronized List<LineBreakpoint> getBreakpoints(String tabFilename) {
524-
List<LineBreakpoint> list = new ArrayList<LineBreakpoint>();
520+
List<LineBreakpoint> list = new ArrayList<>();
525521
for (LineBreakpoint bp : breakpoints) {
526522
if (bp.lineID().fileName().equals(tabFilename)) {
527523
list.add(bp);
@@ -973,7 +969,7 @@ protected String locationToString(Location loc) {
973969
*/
974970
protected List<VariableNode> getLocals(ThreadReference t, int depth) {
975971
//System.out.println("getting locals");
976-
List<VariableNode> vars = new ArrayList<VariableNode>();
972+
List<VariableNode> vars = new ArrayList<>();
977973
try {
978974
if (t.frameCount() > 0) {
979975
StackFrame sf = t.frame(0);
@@ -1015,7 +1011,7 @@ protected List<VariableNode> getThisFields(ThreadReference t, int depth,
10151011
} catch (IncompatibleThreadStateException ex) {
10161012
log(Level.SEVERE, null, ex);
10171013
}
1018-
return new ArrayList<VariableNode>();
1014+
return new ArrayList<>();
10191015
}
10201016

10211017

@@ -1030,7 +1026,7 @@ protected List<VariableNode> getThisFields(ThreadReference t, int depth,
10301026
protected List<VariableNode> getFields(Value value, int depth, int maxDepth,
10311027
boolean includeInherited) {
10321028
// remember: Value <- ObjectReference, ArrayReference
1033-
List<VariableNode> vars = new ArrayList<VariableNode>();
1029+
List<VariableNode> vars = new ArrayList<>();
10341030
if (depth <= maxDepth) {
10351031
if (value instanceof ArrayReference) {
10361032
return getArrayFields((ArrayReference) value);
@@ -1072,7 +1068,7 @@ public List<VariableNode> getFields(Value value, int maxDepth, boolean includeIn
10721068
* @return list of array fields
10731069
*/
10741070
protected List<VariableNode> getArrayFields(ArrayReference array) {
1075-
List<VariableNode> fields = new ArrayList<VariableNode>();
1071+
List<VariableNode> fields = new ArrayList<>();
10761072
if (array != null) {
10771073
String arrayType = array.type().name();
10781074
if (arrayType.endsWith("[]")) {
@@ -1096,7 +1092,7 @@ protected List<VariableNode> getArrayFields(ArrayReference array) {
10961092
* @return call stack as list of {@link DefaultMutableTreeNode}s
10971093
*/
10981094
protected List<DefaultMutableTreeNode> getStackTrace(ThreadReference t) {
1099-
List<DefaultMutableTreeNode> stack = new ArrayList<DefaultMutableTreeNode>();
1095+
List<DefaultMutableTreeNode> stack = new ArrayList<>();
11001096
try {
11011097
for (StackFrame f : t.frames()) {
11021098
stack.add(new DefaultMutableTreeNode(locationToString(f.location())));

0 commit comments

Comments
 (0)