Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8174073

NPE caused by @link reference to class

    Details

    • Subcomponent:
    • Introduced In Build:
      b75
    • Introduced In Version:
      8
    • Resolved In Build:
      b157
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0"
        Java(TM) SE Runtime Environment (build 1.8.0-b132)
        Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

        and

        java 9-ea
        Java(TM) SE Runtime Environment (build 9-ea+152-jigsaw-nightly-h5986-20170119)
        Java HotSpot(TM) 64-Bit Server VM (build 9-ea+152-jigsaw-nightly-h5986-20170119, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 10.0.14393]

        A DESCRIPTION OF THE PROBLEM :
        Issue originally reported at https://issues.apache.org/jira/browse/MJAVADOC-478

        Javadoc contains a link to the simple name of a class (Requirements)

        I assume NPE is caused because Requirements cannot be resolved.

        REGRESSION. Last worked in version 7u76

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.7.0_55"
        Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        https://issues.apache.org/jira/browse/MJAVADOC-478 contains an attachement

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        a clear javadoc error message (not caused by a NPE)
        ACTUAL -
        java.lang.NullPointerException

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        Java8 only gives java.lang.NullPointerException

        Java9 comes with the following stacktrace
        java.lang.NullPointerException
                at jdk.compiler/com.sun.tools.javac.comp.Enter.getClassEnv(Enter.java:159)
                at jdk.compiler/com.sun.tools.javac.api.JavacTrees.getAttrContext(JavacTrees.java:885)
                at jdk.compiler/com.sun.tools.javac.api.JavacTrees.attributeDocReference(JavacTrees.java:422)
                at jdk.compiler/com.sun.tools.javac.api.JavacTrees.getElement(JavacTrees.java:407)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitReference(Checker.java:849)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitReference(Checker.java:102)
                at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCReference.accept(DCTree.java:631)
                at jdk.compiler/com.sun.source.util.DocTreePathScanner.scan(DocTreePathScanner.java:71)
                at jdk.compiler/com.sun.source.util.DocTreeScanner.visitLink(DocTreeScanner.java:296)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitLink(Checker.java:763)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitLink(Checker.java:102)
                at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCLink.accept(DCTree.java:500)
                at jdk.compiler/com.sun.source.util.DocTreePathScanner.scan(DocTreePathScanner.java:71)
                at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:83)
                at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:98)
                at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:106)
                at jdk.compiler/com.sun.source.util.DocTreeScanner.visitDocComment(DocTreeScanner.java:184)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitDocComment(Checker.java:231)
                at jdk.compiler/com.sun.tools.doclint.Checker.visitDocComment(Checker.java:102)
                at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCDocComment.accept(DCTree.java:132)
                at jdk.compiler/com.sun.source.util.DocTreePathScanner.scan(DocTreePathScanner.java:50)
                at jdk.compiler/com.sun.tools.doclint.Checker.scan(Checker.java:193)
                at jdk.compiler/com.sun.tools.doclint.DocLint.scan(DocLint.java:348)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.WorkArounds.runDocLint(WorkArounds.java:108)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getDocCommentTree0(Utils.java:3028)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getDocCommentTree(Utils.java:3056)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils$WeakSoftHashMap.computeIfAbsent(Utils.java:3238)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getCommentHelper(Utils.java:2871)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.hasBlockTag(Utils.java:2953)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.hasBlockTag(Utils.java:2949)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.isHidden(Utils.java:1553)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.ClassTree.buildTree(ClassTree.java:177)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.ClassTree.<init>(ClassTree.java:120)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:200)
                at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:115)
                at jdk.javadoc/jdk.javadoc.doclets.StandardDoclet.run(StandardDoclet.java:71)
                at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:604)
                at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:424)
                at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:341)
                at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
                at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
        1 error

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        package org.bitbucket.cowwoc.requirements.guava;

        /**
         * The following link tag causes a NullPointerException: {@link Requirements}.
         */
        public interface GuavaVerifiers {
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Use FQN(?)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vromero Vicente Arturo Romero Zaldivar
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  10 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: