RFR: JDK-8271258: @param with non-ascii variable names produces incorrect results

Hannes Wallnöfer hannesw at openjdk.java.net
Thu Aug 19 09:44:24 UTC 2021


On Wed, 18 Aug 2021 20:10:48 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

> Please review a simple change to fix the use of non-ASCII characters in @param names.
> 
> The underlying problem was accidentally relying on `DocTree.toString()` for an `IdentifierTree` in `CommentHelper`.  The fix is simply to get the underlying `Name` and call `toString` on that.
> 
> There is some loosely related cleanup in `ParamTaglet`. I did see if it was possible to avoid excessive use of `String` in this part of the code, but that quickly became a rat-hole.
> 
> The existing related test is updated to include this new case, of a Chinese identifier occurring in various places, similar to the test case in the original bug.

The fix and the added test look good, but I think you accidentally dropped a test string in the existing test.

test/langtools/jdk/javadoc/doclet/testUnicode/TestUnicode.java line 64:

> 62:         checkOutput("Code.html", true,
> 63:                 """
> 64:                         """);

Is don't think this is supposed to be an empty string, is it?

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

Changes requested by hannesw (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5168


More information about the javadoc-dev mailing list