mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8201179: Regression due loading java.nio.charset.StandardCharsets during bootstrap
Reviewed-by: sherman, martin
This commit is contained in:
parent
370977cf4f
commit
c40af49970
7 changed files with 33 additions and 16 deletions
|
@ -42,7 +42,6 @@ import jdk.internal.HotSpotIntrinsicCandidate;
|
|||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.ArrayDecoder;
|
||||
import sun.nio.cs.ArrayEncoder;
|
||||
import sun.nio.cs.StandardCharsets;
|
||||
|
||||
import static java.lang.String.LATIN1;
|
||||
import static java.lang.String.UTF16;
|
||||
|
@ -52,9 +51,6 @@ import static java.lang.Character.highSurrogate;
|
|||
import static java.lang.Character.lowSurrogate;
|
||||
import static java.lang.Character.isSupplementaryCodePoint;
|
||||
import static java.lang.StringUTF16.putChar;
|
||||
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.
|
||||
|
@ -70,6 +66,10 @@ class StringCoding {
|
|||
private static final ThreadLocal<SoftReference<StringEncoder>> encoder =
|
||||
new ThreadLocal<>();
|
||||
|
||||
private static final Charset ISO_8859_1 = sun.nio.cs.ISO_8859_1.INSTANCE;
|
||||
private static final Charset US_ASCII = sun.nio.cs.US_ASCII.INSTANCE;
|
||||
private static final Charset UTF_8 = sun.nio.cs.UTF_8.INSTANCE;
|
||||
|
||||
private static <T> T deref(ThreadLocal<SoftReference<T>> tl) {
|
||||
SoftReference<T> sr = tl.get();
|
||||
if (sr == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue