Skip to content
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

adding a null check to avoid NPE in picard #199

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Conversation

lbergelson
Copy link
Member

This seems to fix a bug in picard when running picard docs with java 21. The docs pass and look reasonable with it instead of exploding with an NPE.

java.lang.NullPointerException: Cannot invoke "com.sun.source.doctree.DocTree.getKind()" because "t" is null
        at org.broadinstitute.barclay.help.scanners.UnknownInlineTagScanner.scan(UnknownInlineTagScanner.java:44)
        at org.broadinstitute.barclay.help.scanners.UnknownInlineTagScanner.scan(UnknownInlineTagScanner.java:18)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.visitValue(DocTreeScanner.java:680)
        at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCValue.accept(DCTree.java:1402)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:90)
        at org.broadinstitute.barclay.help.scanners.UnknownInlineTagScanner.scan(UnknownInlineTagScanner.java:50)
        at org.broadinstitute.barclay.help.scanners.UnknownInlineTagScanner.scan(UnknownInlineTagScanner.java:18)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:94)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:109)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:117)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.visitDocComment(DocTreeScanner.java:205)
        at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCDocComment.accept(DCTree.java:358)
        at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:90)
        at org.broadinstitute.barclay.help.scanners.UnknownInlineTagScanner.scan(UnknownInlineTagScanner.java:50)
        at org.broadinstitute.barclay.help.scanners.JavaLanguageModelScanners.getUnknownInlineTags(JavaLanguageModelScanners.java:140)
        at org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler.addCustomBindings(DefaultDocWorkUnitHandler.java:257)
        at picard.util.help.PicardHelpDocWorkUnitHandler.addCustomBindings(PicardHelpDocWorkUnitHandler.java:74)
        at org.broadinstitute.barclay.help.DefaultDocWorkUnitHandler.processWorkUnit(DefaultDocWorkUnitHandler.java:208)
        at org.broadinstitute.barclay.help.DocWorkUnit.processDoc(DocWorkUnit.java:168)
        at org.broadinstitute.barclay.help.HelpDoclet.lambda$processDocs$1(HelpDoclet.java:305)
        at java.base/java.util.TreeMap$KeySpliterator.forEachRemaining(TreeMap.java:3099)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at org.broadinstitute.barclay.help.HelpDoclet.processDocs(HelpDoclet.java:305)
        at org.broadinstitute.barclay.help.HelpDoclet.run(HelpDoclet.java:113)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:575)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:398)
        at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:347)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:57)
        at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:46)

I don't really understand what's going on though so this really needs more investigation / a test before it goes in I think.

@cmnbroad cmnbroad self-assigned this Dec 19, 2023
@cmnbroad
Copy link
Collaborator

I definitely want to look into this before we merge it.

@cmnbroad cmnbroad merged commit 010cf8e into master Jan 7, 2025
1 check passed
@cmnbroad cmnbroad deleted the lb_add_null_check branch January 7, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants