RFR: 8358066: Non-ascii package names gives compilation error "import requires canonical name" [v2]

Jens-Otto Larsen duke at openjdk.org
Tue Jun 3 17:49:51 UTC 2025


On Mon, 2 Jun 2025 19:05:37 GMT, Archie Cobbs <acobbs 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).
>
> Archie Cobbs has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Fix glitch in exception message.
>  - Simplify code using review suggestion.

For what it's worth: I reported the issue, and the test I wrote - splitting a UTF-8 import statement into a list of package-parts and classname using lastIndexOfAscii('.') and utfNumChars - now works fine. 
Building javac and verifying the whole build is too big of a task for me.
This was a trip down memory lane as I did a 5 year stint at Sun Micro some 20 years ago :-) The times of AppServer 8 and start of GlassFish.

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

PR Comment: https://git.openjdk.org/jdk/pull/25567#issuecomment-2936145150


More information about the compiler-dev mailing list