RFR: 8358066: Non-ascii package names gives compilation error "import requires canonical name"
Archie Cobbs
acobbs at openjdk.org
Mon Jun 2 18:16:53 UTC 2025
On Mon, 2 Jun 2025 17:59:19 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> A simple counting bug in `Convert.utfNumChars()` causes bogus compiler errors for `import` statements of non-ASCII class names when the compiler is configured to use one of the older UTF-8 based `Name` table implementations (e.g., by specifying the `-XDuseUnsharedTable=true` flag).
>
> test/langtools/tools/javac/nametable/TestUtfNumChars.java line 42:
>
>> 40:
>> 41: // This is the string "ab«cd≤ef🟢gh"
>> 42: String s = "ab\u00ABcd\u2264ef\ud83d\udd34gh";
>
> Nit: not sure if there's a strong reason to use escapes in the string literal, esp. given the Unicode characters are used in the comment above. Given https://github.com/openjdk/jdk/pull/24574 is integrated, I would say, use UTF-8 in the string literal, and drop the comment?
I was aware of that recent change, but I don't understand the testing mechanics well enough to verify that `-encoding utf-8` is being added to the regression test compilation step on every possible platform (and wouldn't that be a jtreg thing, not an openjdk thing?)
So I was playing it safe, but if you say it's OK to assume compilation is always being done with `-encoding utf-8` then I'll take your word for it :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25567#discussion_r2121844932
More information about the compiler-dev
mailing list