matthiasblaesing commented on issue #8722:
URL: https://github.com/apache/netbeans/issues/8722#issuecomment-3172628325
@lahodaj this is reproducible and looks like a problem in the Linter. Would
you mind having a look?
I got this in the IDE:
```
Caused: java.lang.NullPointerException: Cannot read field "values" because
"values" is null
at com.sun.tools.javac.code.Lint.suppressionsFrom(Lint.java:532)
at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
```
Looking at the code in:
https://github.com/openjdk/jdk/blob/022e29a77533aacabd56820d00ecffa9646a8362/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java#L528-L541
there is a null check missing.
That code breaks independent from the IDE (tested with `Build 35
(2025/8/8)`):
```java
@SuppressWarnings
public class TestX {
public static void main(String[] args) {
}
}
```
```
matthias@enterprise:~/NetBeansProjects/MavenSpielwiese/src/main/java$ LANG=C
~/bin/jdk-25/bin/javac -XDshould-stop.at=FLOW -XDdev Test.java
Test.java:2: error: annotation @SuppressWarnings is missing a default value
for the element 'value'
@SuppressWarnings
^
1 error
An exception has occurred in the compiler (25). Please file a bug against
the Java compiler via the Java bug reporting page (https://bugreport.java.com)
after checking the Bug Database (https://bugs.java.com) for duplicates. Include
your program, the following diagnostic, and the parameters passed to the Java
compiler in your report. Thank you.
java.lang.NullPointerException: Cannot read field "values" because "values"
is null
at
jdk.compiler/com.sun.tools.javac.code.Lint.suppressionsFrom(Lint.java:532)
at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at
java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
at
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
at
jdk.compiler/com.sun.tools.javac.code.Lint.suppressionsFrom(Lint.java:524)
at
jdk.compiler/com.sun.tools.javac.code.Lint.suppressionsFrom(Lint.java:511)
at jdk.compiler/com.sun.tools.javac.code.Lint.augment(Lint.java:82)
at
jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5414)
at
jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5365)
at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5302)
at
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1346)
at
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:968)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
printing javac parameters to: /tmp/javac.20250810_151958.args
matthias@enterprise:~/NetBeansProjects/MavenSpielwiese/src/main/java$
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists