RFR: 8365719: Refactor uses of JLA.uncheckedNewStringNoRepl

Johannes Döbler duke at openjdk.org
Tue Aug 19 18:51:37 UTC 2025


On Mon, 18 Aug 2025 21:34:39 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Refactor uses of JLAuncheckedNewStringNoRepl(byte[], ISO_8859_1) adding JLA.uncheckedNewStringWithLatin1Bytes(byte[]).
> There is no decoding needed, and no exceptions expected or thrown when creating the string from the supplied latin1 bytes. 
> If COMPACT_STRINGS is false, the bytes are inflated to UTF16.

src/java.base/share/classes/java/lang/String.java line 773:

> 771: 
> 772:         if (COMPACT_STRINGS)
> 773:             return new String(src, LATIN1);

small suggestion: add braces around the return statement

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26831#discussion_r2286047919


More information about the core-libs-dev mailing list