From eac7ee7235b0a3acb104d57b7df52c9f1e9586b9 Mon Sep 17 00:00:00 2001 From: Jabe03 Date: Tue, 16 Dec 2025 11:35:23 -0600 Subject: [PATCH 1/2] Added missing Kind 2 Object value --- src/main/java/edu/uiowa/cs/clc/kind2/results/Object.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/uiowa/cs/clc/kind2/results/Object.java b/src/main/java/edu/uiowa/cs/clc/kind2/results/Object.java index b804975..184f559 100644 --- a/src/main/java/edu/uiowa/cs/clc/kind2/results/Object.java +++ b/src/main/java/edu/uiowa/cs/clc/kind2/results/Object.java @@ -23,7 +23,8 @@ public enum Object postAnalysisEnd("postAnalysisEnd"), modelElementSet("modelElementSet"), progress("progress"), - lsp("lsp"); + lsp("lsp"), + modelSetEnumeration("modelSetEnumeration"); private final String value; @@ -60,6 +61,8 @@ public static Object getKind2Object(String kind2Object) return progress; case "lsp": return lsp; + case "modelSetEnumeration": + return modelSetEnumeration; default: throw new UnsupportedOperationException("Value " + kind2Object + " is not defined"); } From fcf5c1771cc70b14b77c40f120a46e34aac3159e Mon Sep 17 00:00:00 2001 From: Jabe03 Date: Tue, 16 Dec 2025 11:35:54 -0600 Subject: [PATCH 2/2] Changed error handling to ignore some empty cases of analyses --- .../java/edu/uiowa/cs/clc/kind2/results/Result.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java b/src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java index ba96447..b064821 100644 --- a/src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java +++ b/src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java @@ -161,7 +161,7 @@ public void initialize(String json) { Analysis kind2Analysis = null; // for post analysis Analysis previousAnalysis = null; - + boolean emptyAnalysis = false; for (JsonElement jsonElement : jsonArray) { String objectType = jsonElement.getAsJsonObject().get(Labels.objectType).getAsString(); Object kind2Object = Object.getKind2Object(objectType); @@ -250,7 +250,8 @@ public void initialize(String json) { PostAnalysis postAnalysis = new PostAnalysis(previousAnalysis, jsonElement); previousAnalysis.setPostAnalysis(postAnalysis); } else { - throw new RuntimeException("Can not parse kind2 json output"); + // This can occur sometimes with no previous analysis when the node had no properties to check. + emptyAnalysis = true; } } @@ -258,6 +259,8 @@ public void initialize(String json) { if (previousAnalysis != null && previousAnalysis.getPostAnalysis() != null) { // finish the post analysis previousAnalysis = null; + } else if (emptyAnalysis){ + //Do nothing, had a no-analysis postAnalysisStart beforehand. } else { throw new RuntimeException("Failed to analyze kind2 json output"); } @@ -269,7 +272,8 @@ public void initialize(String json) { ModelElementSet elementSet = new ModelElementSet(postAnalysis, jsonElement); postAnalysis.addModelElementSet(elementSet); } else { - throw new RuntimeException("Can not parse kind2 json output"); + // This branch gets hit sometimes when we have empty (nonexistent) analyses of nodes with + // no properties to check, causing missing analyses before postAnalyses, as well as this object. } } }