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

Archie Cobbs acobbs at openjdk.org
Tue Jun 3 23:15:26 UTC 2025


On Tue, 3 Jun 2025 21:51:55 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> > Good question. This method is explicitly documented as assuming that the data is valid UTF-8. It's not trying to handle invalid data.
> 
> I meant the validity of `off`, not the UTF-8 data. For example in your test case, if the `off` is 16, it will return 3 chars although the first one is only the trailing byte. So I guess some comment may help here

Well I guess to be more specific the method assumes that the given _range_ of bytes is valid UTF-8. But yes you are right, this could all be better (more precisely) documented. That's for another PR though, I am loath to further delay this one at this point since it's already approved and the JDK 25 lop off happens tomorrow.

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

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


More information about the compiler-dev mailing list