<i18n dev> RFR: 8363925: Remove unused sun.nio.cs.ArrayEncoder::encode
Roger Riggs
rriggs at openjdk.org
Mon Oct 27 14:43:59 UTC 2025
On Mon, 27 Oct 2025 11:42:20 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
> [JDK-6636319] introduced `ArrayEncoder`, composed of _only_ `encode` method. Later on [JDK-8054307] (JEP 254: Compact Strings) removed all its usages. This method can safely be removed, hence this PR. Confirmed that `tier1-2` tests are clear on several platforms after changes.
>
> [JDK-6636319]: https://bugs.openjdk.org/browse/JDK-6636319
> [JDK-8054307]: https://bugs.openjdk.org/browse/JDK-8054307
test/jdk/sun/nio/cs/TestStringCoding.java line 295:
> 293: return IntStream.range(0, bs.length)
> 294: .mapToObj(i -> String.format("0x%02X", bs[i] & 0xFF))
> 295: .collect(Collectors.joining(", ", "[", "]"));
fyi, java.util.HexFormat can do that too:
Suggestion:
return "[" + HexFormat.ofDelimiter(", ").withPrefix("0x").formatHex(bs) + "]";
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27999#discussion_r2465949995
More information about the i18n-dev
mailing list