< prev index next >

src/java.base/share/classes/java/lang/CharacterName.java

Print this page
rev 49550 : 8201179: Regression due loading java.nio.charset.StandardCharsets during bootstrap
Reviewed-by: sherman

*** 27,41 **** import java.io.DataInputStream; import java.io.InputStream; import java.lang.ref.SoftReference; import java.util.Arrays; - import java.util.Locale; import java.util.zip.InflaterInputStream; import java.security.AccessController; import java.security.PrivilegedAction; class CharacterName { private static SoftReference<CharacterName> refCharName; // codepoint -> bkIndex -> lookup -> offset/len --- 27,42 ---- import java.io.DataInputStream; import java.io.InputStream; import java.lang.ref.SoftReference; import java.util.Arrays; import java.util.zip.InflaterInputStream; import java.security.AccessController; import java.security.PrivilegedAction; + import sun.nio.cs.ISO_8859_1; + class CharacterName { private static SoftReference<CharacterName> refCharName; // codepoint -> bkIndex -> lookup -> offset/len
*** 149,159 **** String result = new String(strPool, 0, off >>> 8, off & 0xff); // ASCII return result; } public int getCodePoint(String name) { ! byte[] bname = name.getBytes(java.nio.charset.StandardCharsets.ISO_8859_1); int hsh = hashN(bname, 0, bname.length); int idx = hsIndices[(hsh & 0x7fffffff) % hsIndices.length]; while (idx != -1) { if (getCpHash(idx) == hsh) { int cp = getCp(idx); --- 150,160 ---- String result = new String(strPool, 0, off >>> 8, off & 0xff); // ASCII return result; } public int getCodePoint(String name) { ! byte[] bname = name.getBytes(ISO_8859_1.INSTANCE); int hsh = hashN(bname, 0, bname.length); int idx = hsIndices[(hsh & 0x7fffffff) % hsIndices.length]; while (idx != -1) { if (getCpHash(idx) == hsh) { int cp = getCp(idx);
< prev index next >