On 11/14/19 8:51 AM, Hannes Wallnöfer wrote:
Hi Jon,
This looks good.
Shouldn’t you add the new bug id to the existing one in the test file @bug tag
instead of replacing it?
Yes, good catch. This started off as a new separate test, and only
subsequently completely subsumed the original. I will fix.
-- Jon
Hannes
Am 13.11.2019 um 23:21 schrieb Jonathan Gibbons <[email protected]>:
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/