On Thu, 1 Jul 2021 01:53:51 GMT, Jonathan Gibbons <j...@openjdk.org> wrote:

> Please review a workaround/fix for an NPE in HtmlDocletWriter.
> 
> The underlying problem is triggered by having a method with no comment 
> override a method with bad/malformed comments. That is then handled poorly in 
> `HtmlDocletWriter.commentTagsToContent` which uses an incorrect 
> `CommentHelper`.
> 
> The workaround fix is to check for a null `DocTreePath` from 
> `CommentHelper.getDocTreePath`, and to suppress prin ting the error message 
> in that case.  The error message will typically have been generated for the 
> bad comments in the super type, so dropping the message is not such a bad 
> thing anyway.
> 
> The diagnostic is improved by using a new/different message when the node 
> does not seem to be tag-related.  In addition, the erroneous text is 
> presented "as text" and not "as raw HTML".   These changes affect a couple of 
> otherwise unrelated tests.
> 
> A new test is added, that exercises the conditions that gave rise to the NPE.

Looks good!

-------------

Marked as reviewed by hannesw (Reviewer).

PR: https://git.openjdk.java.net/jdk17/pull/190

Reply via email to