-
Notifications
You must be signed in to change notification settings - Fork 331
Fail early with a JDK not compatible with the JSpecify mode #1310
Description
Discussed very quickly with @msridhar yesterday, so I create a related issue to provide more details.
I see more and more projects using NullAway with JSpecify mode enabled on JVM that does not support it:
- Java 17 to 21.0.7
- Java 21.0.8+ without the
-XDaddTypeAnnotationsToSymbol=trueflag
There is no clear breakage, builds are not always reproducible and users are confused and not aware this is not supported, even if this is specified in the wiki.
Would be nice to fail fast with a related error message when NullAway is running on an unsupported Java version when the JSpecify mode is enabled.
Ideally we would not hardcode the Java versions (since a Java 17 backport of the -XDaddTypeAnnotationsToSymbol=true flag may come), but detect if possible the broken annotation processor behavior. If not possible, detecting Java version would be better than what we have today.