NPE for the package which don't have any constant value
Bhavesh Patel
bhavesh.x.patel at oracle.com
Wed Apr 1 21:55:38 UTC 2015
Hi Shinya,
Thanks you for identifying and contributing the fix for the issue. We have incorporated the fix in a patch that will be pushed to JDK 9 for HTML5 change. I have also added a test for this fix to it.
Regards,
Bhavesh.
----- Original Message -----
From: bitterfoxc at gmail.com
To: javadoc-next-dev at openjdk.java.net
Sent: Wednesday, April 1, 2015 2:08:36 PM GMT -08:00 US/Canada Pacific
Subject: NPE for the package which don't have any constant value
Hi,
I found NPE for the package which don't have any constant value:
/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);
Regards,
shinyafox(Shinya Yoshida)
More information about the javadoc-next-dev
mailing list