RFR: 8354968: Replace unicode sequences in comment text with UTF-8 characters [v3]
Magnus Ihse Bursie
ihse at openjdk.org
Fri May 9 10:04:09 UTC 2025
> As part of the UTF-8 cleaning up done in [JDK-8301971](https://bugs.openjdk.org/browse/JDK-8301971), I looked at where and how we are using unicode sequences (`\uXXXX`). In several string literals, I think the unicode sequences still has merit, if they improve clarity or readability of the code. Some instances are more gray zone. But the places where it does not make sense at all are in comments, as part of fluid text comments. There they are just disruptive and not helpful at all. I tried to locate all such places (but I might have missed places, I did not do a proper lexical analysis to find comments) and fix them.
>
> 99% of this fix is to turn poor `Peter von der Ah\u00e9` into `Peter von der Ahé`. 😆
>
> I checked some random samples on when this was introduced to see if there were some particular commit that mistreated the encoding, but they have been there since the original release of the open JDK source code.
>
> There are likely many more places where direct UTF-8 encoded characters is preferable to unicode sequences, but this seemed like a safe and trivial first start.
Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Merge branch 'master' into unicode-sequence-in-comments
- Merge branch 'master' into unicode-sequence-in-comments
- 8354968: Replace unicode sequences in comment text with UTF-8 characters
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24727/files
- new: https://git.openjdk.org/jdk/pull/24727/files/694b33dc..dd9a77c5
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24727&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24727&range=01-02
Stats: 14771 lines in 491 files changed: 7892 ins; 4380 del; 2499 mod
Patch: https://git.openjdk.org/jdk/pull/24727.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24727/head:pull/24727
PR: https://git.openjdk.org/jdk/pull/24727
More information about the compiler-dev
mailing list