Skip to content
Snippets Groups Projects
Commit e74d8836 authored by dgelessus's avatar dgelessus
Browse files

Fix NPE in OutputCollector.addStateToTrace

This is a breaking change - callers now need to check for isEmpty()
instead of null.
parent 25509383
No related branches found
No related tags found
No related merge requests found
Pipeline #140127 passed
...@@ -17,7 +17,7 @@ import tlc2.tool.TLCStateInfo; ...@@ -17,7 +17,7 @@ import tlc2.tool.TLCStateInfo;
public class OutputCollector { public class OutputCollector {
private static TLCState initialState = null; private static TLCState initialState = null;
private static List<TLCStateInfo> trace = null; private static List<TLCStateInfo> trace = new ArrayList<>();
private static List<Message> allMessages = new ArrayList<>(); private static List<Message> allMessages = new ArrayList<>();
private static Map<Location, Long> lineCount = new HashMap<>(); private static Map<Location, Long> lineCount = new HashMap<>();
private static ModuleNode moduleNode = null; private static ModuleNode moduleNode = null;
...@@ -32,9 +32,6 @@ public class OutputCollector { ...@@ -32,9 +32,6 @@ public class OutputCollector {
} }
public static void addStateToTrace(TLCStateInfo tlcStateInfo) { public static void addStateToTrace(TLCStateInfo tlcStateInfo) {
if (trace == null) {
trace = new ArrayList<>();
}
trace.add(tlcStateInfo); trace.add(tlcStateInfo);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment