RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]

Claes Redestad redestad at openjdk.org
Tue Sep 3 15:01:22 UTC 2024


On Tue, 3 Sep 2024 14:32:16 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> We might rename these to `countAscii` and `countModifiedUtf8Compatible`.
>
> ascii includes '\0', `CountModifiedUtf8Compatible` Newbies don't seem to know what it means

I think naming internal low-level methods based precisely on what they do rather than their intended purpose is fine: we're counting positives and zeros in a byte array. Good! Higher level API methods called `isAscii(byte[] utf8Bytes)` et.c. which calls the low-level methods? Also good!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20772#discussion_r1742225537


More information about the core-libs-dev mailing list