Closed sdavids closed 1 week ago
anyone else seeing this?... i'm not.
$ mkdir -p /tmp/test && cd "$_"
$ cat <<'EOF' >Dockerfile
FROM eclipse-temurin:21.0.4_7-jdk-jammy
ENV JSPECIFY_VERSION=1.0.0
ENV SPOTBUGS_VERSION=4.8.6
ENV SB_CONTRIB_VERSION=7.6.6
ENV SPOTBUGS_HOME=spotbugs-$SPOTBUGS_VERSION
RUN curl -L -O -s https://repo1.maven.org/maven2/org/jspecify/jspecify/$JSPECIFY_VERSION/jspecify-$JSPECIFY_VERSION.jar
RUN curl -L -O -s https://github.com/spotbugs/spotbugs/releases/download/$SPOTBUGS_VERSION/spotbugs-$SPOTBUGS_VERSION.tgz
RUN tar -xzf spotbugs-$SPOTBUGS_VERSION.tgz && rm spotbugs-$SPOTBUGS_VERSION.tgz
RUN 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
RUN mkdir -p example/test
RUN printf 'package test;\nimport org.jspecify.annotations.Nullable;\nclass Test {\n @Nullable Object get() {\n return null;\n }\n}\n' > example/test/Test.java
RUN javac -cp jspecify-$JSPECIFY_VERSION.jar example/test/Test.java
RUN java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example
EOF
$ docker build --progress=plain .
...
#12 [9/9] RUN java -jar spotbugs-4.8.6/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-1.0.0.jar -effort:max -low -longBugCodes example
#12 0.689 Exception in thread "main" java.lang.ExceptionInInitializerError
#12 0.689 at edu.umd.cs.findbugs.DetectorFactoryCollection.getCoreResource(DetectorFactoryCollection.java:353)
#12 0.689 at edu.umd.cs.findbugs.SystemProperties.loadPropertiesFromConfigFile(SystemProperties.java:84)
#12 0.689 at edu.umd.cs.findbugs.SystemProperties.<clinit>(SystemProperties.java:67)
#12 0.689 at edu.umd.cs.findbugs.FindBugs2.<clinit>(FindBugs2.java:98)
#12 0.689 at edu.umd.cs.findbugs.LaunchAppropriateUI.launch(LaunchAppropriateUI.java:106)
#12 0.689 at edu.umd.cs.findbugs.LaunchAppropriateUI.main(LaunchAppropriateUI.java:198)
#12 0.689 Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "this.classLoader" is null
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.getPluginDescriptor(PluginLoader.java:1194)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:737)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.<init>(PluginLoader.java:210)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.getPluginLoader(PluginLoader.java:1378)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugin(PluginLoader.java:1500)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.loadPluginsInDir(PluginLoader.java:1430)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.loadPlugins(PluginLoader.java:1405)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.installStandardPlugins(PluginLoader.java:1400)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1448)
#12 0.690 at edu.umd.cs.findbugs.PluginLoader.<clinit>(PluginLoader.java:153)
#12 0.690 ... 6 more
#12 ERROR: process "/bin/sh -c java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example" did not complete successfully: exit code: 1
------
> [9/9] RUN java -jar spotbugs-4.8.6/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-1.0.0.jar -effort:max -low -longBugCodes example:
0.690 at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:737)
0.690 at edu.umd.cs.findbugs.PluginLoader.<init>(PluginLoader.java:210)
0.690 at edu.umd.cs.findbugs.PluginLoader.getPluginLoader(PluginLoader.java:1378)
0.690 at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugin(PluginLoader.java:1500)
0.690 at edu.umd.cs.findbugs.PluginLoader.loadPluginsInDir(PluginLoader.java:1430)
0.690 at edu.umd.cs.findbugs.PluginLoader.loadPlugins(PluginLoader.java:1405)
0.690 at edu.umd.cs.findbugs.PluginLoader.installStandardPlugins(PluginLoader.java:1400)
0.690 at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1448)
0.690 at edu.umd.cs.findbugs.PluginLoader.<clinit>(PluginLoader.java:153)
0.690 ... 6 more
------
Dockerfile:25
...
oh, i think this is the problem, looking at the output of docker build
you want
OK, I checked it.
I would still say it is regression though:
With version 7.6.5
it (using fb-contrib-7.6.5.jar
with SpotBugs) works, with version 7.6.6
it does not.
It is a behavioural change even if it was unintentional behaviour—that is not something one expects in a patch release.
$ mkdir -p /tmp/test && cd "$_"
$ cat <<'EOF' >Dockerfile
FROM eclipse-temurin:21.0.4_7-jdk-jammy
ENV JSPECIFY_VERSION=1.0.0
ENV SPOTBUGS_VERSION=4.8.6
ENV SB_CONTRIB_VERSION=7.6.6
ENV SPOTBUGS_HOME=spotbugs-$SPOTBUGS_VERSION
RUN curl -L -O -s https://repo1.maven.org/maven2/org/jspecify/jspecify/$JSPECIFY_VERSION/jspecify-$JSPECIFY_VERSION.jar
RUN curl -L -O -s https://github.com/spotbugs/spotbugs/releases/download/$SPOTBUGS_VERSION/spotbugs-$SPOTBUGS_VERSION.tgz
RUN tar -xzf spotbugs-$SPOTBUGS_VERSION.tgz && rm spotbugs-$SPOTBUGS_VERSION.tgz
RUN 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
RUN mkdir -p example/test
RUN printf 'package test;\nimport org.jspecify.annotations.Nullable;\nclass Test {\n @Nullable Object get() {\n return null;\n }\n}\n' > example/test/Test.java
RUN javac -cp jspecify-$JSPECIFY_VERSION.jar example/test/Test.java
RUN java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example
EOF
$ docker build --progress=plain --no-cache .
...
#12 [9/9] RUN java -jar spotbugs-4.8.6/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-1.0.0.jar -effort:max -low -longBugCodes example
#12 0.689 Exception in thread "main" java.lang.ExceptionInInitializerError
...
$ cat <<'EOF' >Dockerfile
FROM eclipse-temurin:21.0.4_7-jdk-jammy
ENV JSPECIFY_VERSION=1.0.0
ENV SPOTBUGS_VERSION=4.8.6
ENV SB_CONTRIB_VERSION=7.6.5
ENV SPOTBUGS_HOME=spotbugs-$SPOTBUGS_VERSION
RUN curl -L -O -s https://repo1.maven.org/maven2/org/jspecify/jspecify/$JSPECIFY_VERSION/jspecify-$JSPECIFY_VERSION.jar
RUN curl -L -O -s https://github.com/spotbugs/spotbugs/releases/download/$SPOTBUGS_VERSION/spotbugs-$SPOTBUGS_VERSION.tgz
RUN tar -xzf spotbugs-$SPOTBUGS_VERSION.tgz && rm spotbugs-$SPOTBUGS_VERSION.tgz
RUN 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
RUN mkdir -p example/test
RUN printf 'package test;\nimport org.jspecify.annotations.Nullable;\nclass Test {\n @Nullable Object get() {\n return null;\n }\n}\n' > example/test/Test.java
RUN javac -cp jspecify-$JSPECIFY_VERSION.jar example/test/Test.java
RUN java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example
EOF
$ docker build --progress=plain --no-cache .
...
#12 [9/9] RUN java -jar spotbugs-4.8.6/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-1.0.0.jar -effort:max -low -longBugCodes example
#12 1.610 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]
#12 DONE 1.7s
...
$ cat <<'EOF' >Dockerfile
FROM eclipse-temurin:21.0.4_7-jdk-jammy
ENV JSPECIFY_VERSION=1.0.0
ENV SPOTBUGS_VERSION=4.8.6
ENV SB_CONTRIB_VERSION=7.6.6
ENV SPOTBUGS_HOME=spotbugs-$SPOTBUGS_VERSION
RUN curl -L -O -s https://repo1.maven.org/maven2/org/jspecify/jspecify/$JSPECIFY_VERSION/jspecify-$JSPECIFY_VERSION.jar
RUN curl -L -O -s https://github.com/spotbugs/spotbugs/releases/download/$SPOTBUGS_VERSION/spotbugs-$SPOTBUGS_VERSION.tgz
RUN tar -xzf spotbugs-$SPOTBUGS_VERSION.tgz && rm spotbugs-$SPOTBUGS_VERSION.tgz
RUN curl -L -O -s --output-dir $SPOTBUGS_HOME/plugin https://repo1.maven.org/maven2/com/mebigfatguy/sb-contrib/sb-contrib/$SB_CONTRIB_VERSION/sb-contrib-$SB_CONTRIB_VERSION.jar
RUN mkdir -p example/test
RUN printf 'package test;\nimport org.jspecify.annotations.Nullable;\nclass Test {\n @Nullable Object get() {\n return null;\n }\n}\n' > example/test/Test.java
RUN javac -cp jspecify-$JSPECIFY_VERSION.jar example/test/Test.java
RUN java -jar $SPOTBUGS_HOME/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-$JSPECIFY_VERSION.jar -effort:max -low -longBugCodes example
EOF
$ docker build --progress=plain --no-cache .
...
#12 [9/9] RUN java -jar spotbugs-4.8.6/lib/spotbugs.jar -textui -sourcepath example -auxclasspath=./jspecify-1.0.0.jar -effort:max -low -longBugCodes example
#12 1.550 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]
#12 DONE 1.6s
...
i wouldn't expect 7.6.5 fb to work with spotbugs. Not sure why that would happen.
Downgrading to
7.6.5
will remove the exception: