diff --git a/src/main/java/org/checkerframework/specimin/UnsolvedSymbolVisitor.java b/src/main/java/org/checkerframework/specimin/UnsolvedSymbolVisitor.java index e4482a438..071eabe9a 100644 --- a/src/main/java/org/checkerframework/specimin/UnsolvedSymbolVisitor.java +++ b/src/main/java/org/checkerframework/specimin/UnsolvedSymbolVisitor.java @@ -1008,13 +1008,8 @@ public Visitable visit(ConstructorDeclaration node, Void arg) { (ClassOrInterfaceDeclaration) JavaParserUtil.getEnclosingClassLike(node); for (FieldDeclaration field : thisClass.getFields()) { for (VariableDeclarator variable : field.getVariables()) { - if (variable.getType().isClassOrInterfaceType()) { - solveSymbolsForClassOrInterfaceType( - variable.getType().asClassOrInterfaceType(), false); - } else { - throw new RuntimeException( - "fields can also have this type: " + variable.getType().getClass()); - } + Type type = variable.getType(); + resolveTypeExpr(type); } } } diff --git a/src/main/resources/preservation_status.json b/src/main/resources/preservation_status.json index d6fced59f..753420656 100644 --- a/src/main/resources/preservation_status.json +++ b/src/main/resources/preservation_status.json @@ -24,7 +24,7 @@ "na-102": "PASS", "na-103": "PASS", "na-176": "PASS", - "na-323": "FAIL", + "na-323": "PASS", "na-347": "PASS", "na-389": "PASS", "na-705": "FAIL", diff --git a/src/test/resources/nullaway-ctors/expected/com/example/Simple.java b/src/test/resources/nullaway-ctors/expected/com/example/Simple.java index 11fd0c6d1..bb8c504bb 100644 --- a/src/test/resources/nullaway-ctors/expected/com/example/Simple.java +++ b/src/test/resources/nullaway-ctors/expected/com/example/Simple.java @@ -5,6 +5,8 @@ class Simple { private Foo bar; + private int x; + public Simple() { } } diff --git a/src/test/resources/nullaway-ctors/input/com/example/Simple.java b/src/test/resources/nullaway-ctors/input/com/example/Simple.java index 243581d0f..e53d39207 100644 --- a/src/test/resources/nullaway-ctors/input/com/example/Simple.java +++ b/src/test/resources/nullaway-ctors/input/com/example/Simple.java @@ -5,6 +5,8 @@ class Simple { private Foo bar; + private int x; + public Simple() { // No initialization of a field can change NullAway's output, // so the NullAway modularity model needs to preserve all fields