From 38ee41bee390e3d4aaa57cc090f7956cf8b9fe8b Mon Sep 17 00:00:00 2001 From: April Ivy Date: Fri, 26 Jun 2026 06:32:10 +0000 Subject: [PATCH] 8365887: Outdated comments in String::decode Reviewed-by: liach, sherman --- src/java.base/share/classes/java/lang/String.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index 760f3ebc255..9f56ceb445a 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -671,14 +671,6 @@ public final class String } private static String decode(Charset charset, byte[] bytes, int offset, int length) { - // (1)We never cache the "external" cs, the only benefit of creating - // an additional StringDe/Encoder object to wrap it is to share the - // de/encode() method. These SD/E objects are short-lived, the young-gen - // gc should be able to take care of them well. But the best approach - // is still not to generate them if not really necessary. - // (2)The defensive copy of the input byte/char[] has a big performance - // impact, as well as the outgoing result byte/char[]. Need to do the - // optimization check of (sm==null && classLoader0==null) for both. CharsetDecoder cd = charset.newDecoder(); // ArrayDecoder fastpaths if (cd instanceof ArrayDecoder ad) {