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

Jonathan Gibbons jjg at openjdk.java.net
Wed Aug 18 20:17:39 UTC 2021


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.

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

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

Changes: https://git.openjdk.java.net/jdk/pull/5168/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5168&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271258
  Stats: 94 lines in 3 files changed: 63 ins; 6 del; 25 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5168.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5168/head:pull/5168

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


More information about the javadoc-dev mailing list