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 printing 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. This pull request has now been integrated. Changeset: 64016338 Author: Jonathan Gibbons <j...@openjdk.org> URL: https://git.openjdk.java.net/jdk17/commit/6401633800daff1bb80ec7e134edbaa1dbcc8499 Stats: 113 lines in 5 files changed: 107 ins; 0 del; 6 mod 8269722: NPE in HtmlDocletWriter Reviewed-by: hannesw ------------- PR: https://git.openjdk.java.net/jdk17/pull/190