[OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module

Sergey Bylokhov serb at openjdk.java.net
Sun Aug 1 08:47:24 UTC 2021

This is a request to clean up a desktop module as was done in JDK-8233884 for "java.base" module.

In many places standard charsets are looked up via their names, for example:

This could be done more efficiently(x20 time faster) with use of java.nio.charset.StandardCharsets:

The later variant also makes the code cleaner, as it is known not to throw UnsupportedEncodingException in contrary to the former variant.

Tested by the desktop headless/headful tests on linux/windows.


Commit messages:
 - Initial fix for JDK-8271456

Changes: https://git.openjdk.java.net/jdk/pull/4951/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4951&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271456
  Stats: 641 lines in 28 files changed: 276 ins; 237 del; 128 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4951.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4951/head:pull/4951

PR: https://git.openjdk.java.net/jdk/pull/4951

More information about the 2d-dev mailing list