On Wed, 24 Jun 2026 16:23:55 GMT, April Ivy <[email protected]> wrote:
> As noted in https://bugs.openjdk.org/browse/JDK-8365887, the comment in > `String::decode` still referred to the old defensive copy / security manager > optimization even though that path has been removed. > > This updates the comment to describe the current shape of the method: a > short-lived `CharsetDecoder` is created for this decode path, while the > `ArrayDecoder` fast paths decode directly from arrays where possible. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Changes requested by liach (Reviewer). src/java.base/share/classes/java/lang/String.java line 676: > 674: // Do not cache the CharsetDecoder created here. It is > short-lived, > 675: // so young-generation GC should handle it well. The ArrayDecoder > 676: // fast paths below decode directly from arrays where possible. Suggestion: This remaining stub IMO is meaningless too. ------------- PR Review: https://git.openjdk.org/jdk/pull/31661#pullrequestreview-4566331542 PR Review Comment: https://git.openjdk.org/jdk/pull/31661#discussion_r3470603688
