GP-0: fix for ISF test failures

This commit is contained in:
d-millar
2023-12-01 22:51:33 +00:00
parent 7292b594b1
commit 15bcfc2594
3 changed files with 15 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ public abstract class AbstractIsfWriter implements Closeable {
protected JsonArray objects = new JsonArray();
public AbstractIsfWriter(Writer baseWriter) throws IOException {
if (writer != null) {
if (baseWriter != null) {
this.writer = new JsonWriter(baseWriter);
writer.setIndent(" ");
}

View File

@@ -84,7 +84,6 @@ public class IsfDataTypeWriter extends AbstractIsfWriter {
private List<Address> requestedAddresses = new ArrayList<>();
private List<String> requestedSymbols = new ArrayList<>();
// private List<String> requestedTypes = new ArrayList<>();
private List<DataType> requestedDataTypes = new ArrayList<>();
private boolean skipSymbols = false;
private boolean skipTypes = false;
@@ -99,6 +98,7 @@ public class IsfDataTypeWriter extends AbstractIsfWriter {
*/
public IsfDataTypeWriter(DataTypeManager dtm, List<DataType> target, Writer baseWriter) throws IOException {
super(baseWriter);
this.baseWriter = baseWriter;
this.dtm = dtm;
if (dtm != null) {
dataOrganization = dtm.getDataOrganization();
@@ -113,10 +113,15 @@ public class IsfDataTypeWriter extends AbstractIsfWriter {
enums = new JsonObject();
functions = new JsonObject();
symbols = new JsonObject();
requestedDataTypes = target;
requestedDataTypes = target == null ? new ArrayList<>() : target;
STRICT = true;
}
public JsonObject getRootObject(TaskMonitor monitor) throws CancelledException, IOException {
genRoot(monitor);
return data;
}
@Override
protected void genRoot(TaskMonitor monitor) throws CancelledException, IOException {
genMetadata();