Description
Any null literal (x = null, x == null, new IIOImage(img, null, null)) produces Error: Null literals are not supported, and the rest of the file is not verified. Null checks are everywhere in real code.
Minimal reproducer
public class Repro {
public static void main(String[] args) {
String name = null;
if (name == null) {
System.out.println("no name");
}
}
}
Expected
At least no error: until nulls are supported in refinements, treat a null literal (and comparisons with it) as carrying no information, the same as an unknown value.
Actual
Running LiquidJava on: <repro dir>
Error: Null literals are not supported
2 | public static void main(String[] args) {
3 | String name = null;
4 | if (name == null) {
| ^^^^
5 | System.out.println("no name");
6 | }
Reproduced on main at 8816186 (liquidjava-verifier 0.0.35), and on 0.0.33.
Context
Found while turning real open-source Java code into study examples for the error-message study: real code hits this constantly, so the examples have to be rewritten around it or cannot be verified. It affects 6 of 12 examples (blocks one, and forces rewrites in five, e.g. X s = null; try { s = new X(); ... } finally { if (s != null) s.close(); }).
Description
Any
nullliteral (x = null,x == null,new IIOImage(img, null, null)) producesError: Null literals are not supported, and the rest of the file is not verified. Null checks are everywhere in real code.Minimal reproducer
Expected
At least no error: until nulls are supported in refinements, treat a
nullliteral (and comparisons with it) as carrying no information, the same as an unknown value.Actual
Reproduced on
mainat 8816186 (liquidjava-verifier 0.0.35), and on 0.0.33.Context
Found while turning real open-source Java code into study examples for the error-message study: real code hits this constantly, so the examples have to be rewritten around it or cannot be verified. It affects 6 of 12 examples (blocks one, and forces rewrites in five, e.g.
X s = null; try { s = new X(); ... } finally { if (s != null) s.close(); }).