Hi all,
I am a bit confused about the current default handling of unannotated class files / jars by the nullness checker. My test case has two files T1.java and T2.java:
T1.java
----------
public class T1 {
public static void checkStr(String s) {
// uncommenting this line doesn't seem to make a difference,
// but including just in case
// s.toString();
}
}
T2.java
----------
public class T2 {
public static void main(String[] args) {
T1.checkStr(null);
}
}
First, I run javac T1.java, i.e., without the nullness checker. Then, I run javac -processor org.checkerframework.checker.nullness.NullnessChecker T2.java. I would expect that with the unsound defaults, I would *not* get an error in this situation, since there are no annotations in the T1.class file. However, the Checker framework (version 2.1.7) is in fact reporting an error at the call T1.checkStr(null) inside T2.
Have I misunderstood something? Is the above the expected behavior? If there is a configuration of the nullness checker that treats unannotated libraries / class files unsoundly (something like assuming all method parameters are @Nullable and all return values are @NonNull), I'd be interested in knowing how to run it. Thanks!
Best,
Manu
Best,
Manu