mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8174831: Reduce number of Charset classes loaded on bootstrap
Reviewed-by: alanb
This commit is contained in:
parent
bf8ad52b22
commit
e17bdd6c77
4 changed files with 29 additions and 21 deletions
|
@ -46,9 +46,6 @@ import sun.nio.cs.ArrayEncoder;
|
|||
import static java.lang.String.LATIN1;
|
||||
import static java.lang.String.UTF16;
|
||||
import static java.lang.String.COMPACT_STRINGS;
|
||||
import static java.nio.charset.StandardCharsets.ISO_8859_1;
|
||||
import static java.nio.charset.StandardCharsets.US_ASCII;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* Utility class for string encoding and decoding.
|
||||
|
@ -64,6 +61,10 @@ class StringCoding {
|
|||
private static final ThreadLocal<SoftReference<StringEncoder>> encoder =
|
||||
new ThreadLocal<>();
|
||||
|
||||
private static final Charset ISO_8859_1 = Charset.forName("iso-8859-1");
|
||||
private static final Charset US_ASCII = Charset.forName("us-ascii");
|
||||
private static final Charset UTF_8 = Charset.forName("utf-8");
|
||||
|
||||
private static boolean warnUnsupportedCharset = true;
|
||||
|
||||
private static <T> T deref(ThreadLocal<SoftReference<T>> tl) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue