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

NPE for the package which don't have any constant value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • tools

      I found NPE for the package which don't have any constant value in JavaDoc.Next/render repo:
      http://hg.openjdk.java.net/javadoc-next/render/

      /tmp/test/Test.java
      package test;
      public class Test
      {
          // there is no constant value in test packages
      }

      $ /PATH_TO_JAVADOC_NEXT_JDK_IMAGE/bin/javadoc -html5 -sourcepath /tmp test

      Loading source files for package test...
      Constructing Javadoc information...
      Standard Doclet version 1.8.0
      Building tree for all the packages and classes...
      Generating /tmp/javadoc/test/Test.html...
      Generating /tmp/javadoc/test/package-frame.html...
      Generating /tmp/javadoc/test/package-summary.html...
      Generating /tmp/javadoc/test/package-tree.html...
      Generating /tmp/javadoc/constant-values.html...
      javadoc: error - java.lang.NullPointerException
      1 error

      Here is the possible fix:
      diff -r 228f66693293 src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java
      --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java Tue Feb 24 16:13:47 2015 -0800
      +++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java Thu Apr 02 06:00:24 2015 +0900
      @@ -347,7 +347,7 @@
            * {@inheritDoc}
            */
           public void addConstantSummaries(Content contentTree, Content summariesTree) {
      - if (configuration.allowTag(HtmlTag.SECTION))
      + if (configuration.allowTag(HtmlTag.SECTION) && summaryTree != null)
                   summariesTree.addContent(summaryTree);
               if (configuration.allowTag(HtmlTag.MAIN)) {
                   mainTree.addContent(summariesTree);

            Unassigned Unassigned
            shinyafox Shinya Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: