Please review a relatively simple update to fix a javadoc crash that could be caused by putting HTML files in a doc-files subdirectory for a module.

The crash occurred because of a "not supported" check that protected against an underlying NPE in a method in javax.lang.model.util.Elements that has now been fixed. (JDK-8234025)

The fix is to enable and update the code path, and to rewrite/extend the corresponding test to cover 3 test cases:

 * doc-files for a module  (new)
 * doc-files for a package in a module (not previously tested)
 * doc-files for a package that is not in a module (original test behavior)

General note/discussion:

The doc-files support uses a method com.sun.source.util.DocTrees#getDocDommentTree(PackageElement, JavaFileObject).

When originally designing the support for module doc-files, the choice was either to add an overload to this method taking a ModuleElement, or to leverage the existing method, using a PackageElement for the module's unnamed package (which effectively represents the same position in the source hierarchy).  The latter choice was chosen, but ran into the underlying NPE when attempting to access the unnamed package for the module. Now that the NPE has been fixed, we can unblock the new behavior.

-- Jon

JBS: https://bugs.openjdk.java.net/browse/JDK-8233874
Webrev: http://cr.openjdk.java.net/~jjg/8233874/webrev.00/


Reply via email to