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

Weaken some collection types

parent 04cebe7b
No related branches found
No related tags found
No related merge requests found
Pipeline #139805 failed
......@@ -14,8 +14,8 @@ public class Log {
public static final String DELIMITER = ";";
private final ArrayList<String> fieldNames = new ArrayList<>();
private final ArrayList<String> fieldValues = new ArrayList<>();
private final List<String> fieldNames = new ArrayList<>();
private final List<String> fieldValues = new ArrayList<>();
public Log(TLC4B tlc4b, TLCResults tlcResults) {
fieldNames.add("Machine File");
......
......@@ -11,7 +11,7 @@ import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.*;
......@@ -175,7 +175,7 @@ public class TLC4B {
}
private void printOperationsCount(TLCResults results) {
LinkedHashMap<String, Long> operationCount = results.getOperationCount();
Map<String, Long> operationCount = results.getOperationCount();
if (TLC4BGlobals.isPrintCoverage() && operationCount != null) {
printlnSilent("---------- Coverage statistics ----------");
for (Entry<String, Long> entry : operationCount.entrySet()) {
......
......@@ -24,8 +24,8 @@ public class TLCResults implements ToolGlobals {
private String violatedDefinition, tlcErrorMessage;
private Date startTime;
private Date endTime;
private LinkedHashMap<String, Long> operationsCount;
private final ArrayList<String> violatedAssertions = new ArrayList<>();
private Map<String, Long> operationsCount;
private final List<String> violatedAssertions = new ArrayList<>();
private int lengthOfTrace;
private String traceString, traceFile;
......@@ -55,7 +55,7 @@ public class TLCResults implements ToolGlobals {
}
}
public LinkedHashMap<String, Long> getOperationCount() {
public Map<String, Long> getOperationCount() {
return operationsCount;
}
......@@ -76,7 +76,7 @@ public class TLCResults implements ToolGlobals {
return violatedDefinition;
}
public ArrayList<String> getViolatedAssertions() {
public List<String> getViolatedAssertions() {
return this.violatedAssertions;
}
......@@ -120,7 +120,7 @@ public class TLCResults implements ToolGlobals {
lineCount.put(endline, entry.getValue());
}
}
ArrayList<OpDefNode> defs = getActionsFromGeneratedModule(OutputCollector.getModuleNode());
List<OpDefNode> defs = getActionsFromGeneratedModule(OutputCollector.getModuleNode());
operationsCount = new LinkedHashMap<>();
for (OpDefNode opDefNode : defs) {
String operationName = opDefNode.getName().toString();
......@@ -132,9 +132,9 @@ public class TLCResults implements ToolGlobals {
}
}
private ArrayList<OpDefNode> getActionsFromGeneratedModule(ModuleNode moduleNode) {
private List<OpDefNode> getActionsFromGeneratedModule(ModuleNode moduleNode) {
// list of actions in the module
ArrayList<OpDefNode> actions = new ArrayList<>();
List<OpDefNode> actions = new ArrayList<>();
// get all definitions from the module
OpDefNode[] opDefs = moduleNode.getOpDefs();
......@@ -178,7 +178,7 @@ public class TLCResults implements ToolGlobals {
}
private void evalTrace() {
ArrayList<TLCStateInfo> trace = OutputCollector.getTrace();
List<TLCStateInfo> trace = OutputCollector.getTrace();
TracePrinter printer = null;
if (trace != null) {
printer = new TracePrinter(trace, tlcOutputInfo);
......@@ -192,7 +192,7 @@ public class TLCResults implements ToolGlobals {
private void evalAllMessages() {
ArrayList<Message> messages = new ArrayList<>(OutputCollector.getAllMessages());
List<Message> messages = new ArrayList<>(OutputCollector.getAllMessages());
for (Message m : messages) {
switch (m.getMessageClass()) {
case ERROR:
......@@ -281,8 +281,7 @@ public class TLCResults implements ToolGlobals {
case EC.TLC_ASSUMPTION_FALSE:
// get the violated assumption expr from the OutputCollector
ArrayList<ExprNode> violatedAssumptions = OutputCollector
.getViolatedAssumptions();
List<ExprNode> violatedAssumptions = OutputCollector.getViolatedAssumptions();
if (!violatedAssumptions.isEmpty()) {
// try to find the assume node contain the expr in order to get
// the name of the assumption
......
package de.tlc4b.tlc;
import java.util.ArrayList;
import java.util.List;
import de.tlc4b.btypes.BType;
import de.tlc4b.btypes.FunctionType;
......@@ -17,16 +18,16 @@ import static tlc2.value.ValueConstants.*;
public class TracePrinter {
ArrayList<TLCStateInfo> trace;
List<TLCStateInfo> trace;
TLCState initialState;
final TLCOutputInfo tlcOutputInfo;
ArrayList<OpDeclNode> constants;
ArrayList<OpDeclNode> variables;
List<OpDeclNode> constants;
List<OpDeclNode> variables;
StringBuilder traceBuilder;
public TracePrinter(ArrayList<TLCStateInfo> trace, TLCOutputInfo tlcOutputInfo) {
public TracePrinter(List<TLCStateInfo> trace, TLCOutputInfo tlcOutputInfo) {
this.trace = trace;
this.tlcOutputInfo = tlcOutputInfo;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment