-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI_ANNOTATION_ISSUES_NEEDS_NULLABLE support JSpecify out-of-the-box #473
Comments
I don't understand what your issue is just by reading the description. Can you add more detail? |
Using them errors out with:
See the reproducer above. Yes, one could add them as custom annotations ( |
:D Nice optimism you have there. Shame if something happened to it... If and when a standard actually becomes the standard, then it makes sense to support it out-of-the-box. |
Who is involved: So basically every major party involved with Nullness-checking besides FindBugs/SpotBugs. Yes, it is led by Google and their spectacular track record. And yes, I am aware of the relationship JSR304 ⇔ William Pugh ⇔ FindBugs.
There will never be the standard unless it is part of the Java Spec which most likely never happens in our lifetime 😉 The less tools support the JSpecify effort, the more likely it is that we are stuck with JSR 305 and everybody doing their own thing™—which we have for 18 years; made worse by the Java 9
<1> corresponding organization participates in JSpecify effort <2> JSR working group is non-existent Other adopters: https://kotlinlang.org/docs/whatsnew1520.html#support-for-jspecify-nullness-annotations |
This has not been fixed in $ mkdir -p /tmp/test/example/test && cd "$_/../.."
$ echo 'java=21.0.4-tem' > .sdkmanrc && sdk env
$ printf 'package test;\nimport org.jspecify.annotations.Nullable;\nclass Test {\n @Nullable Object get() {\n return null;\n }\n}\n' > example/Test.java
$ cat example/Test.java
package test;
import org.jspecify.annotations.Nullable;
class Test {
@Nullable Object get() {
return null;
}
}
$ JSPECIFY_VERSION=1.0.0
$ curl -L -O -s https://repo1.maven.org/maven2/org/jspecify/jspecify/$JSPECIFY_VERSION/jspecify-$JSPECIFY_VERSION.jar
$ javac -cp jspecify-$JSPECIFY_VERSION.jar example/Test.java
$ SPOTBUGS_VERSION=4.8.6
$ SB_CONTRIB_VERSION=7.6.5
$ curl -L -O -s https:/spotbugs/spotbugs/releases/download/$SPOTBUGS_VERSION/spotbugs-$SPOTBUGS_VERSION.tgz
$ tar -xzf spotbugs-$SPOTBUGS_VERSION.tgz && rm spotbugs-$SPOTBUGS_VERSION.tgz
$ SPOTBUGS_HOME=spotbugs-$SPOTBUGS_VERSION
$ curl -L -O -s --output-dir $SPOTBUGS_HOME/plugin https://repo1.maven.org/maven2/com/mebigfatguy/fb-contrib/fb-contrib/$SB_CONTRIB_VERSION/fb-contrib-$SB_CONTRIB_VERSION.jar
$ java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example
L C AI_ANNOTATION_ISSUES_NEEDS_NULLABLE AI: Method test.Test.get() that can return null, is missing a @Nullable annotation At Test.java:[line 5] |
Also, I cannot find a changelog, release notes or GitHub releases?!? This one stops at 7.4.0. |
JSpecify - What is this
org.jspecify.annotations.Nullable
The text was updated successfully, but these errors were encountered: