8234147: Avoid looking up standard charsets in core libraries

Reviewed-by: alanb
This commit is contained in:
Ivan Gerasimov 2019-12-01 15:29:37 -08:00
parent 4e64af81a2
commit cd589d8469
36 changed files with 200 additions and 237 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -151,7 +151,7 @@ class CharacterName {
}
public int getCodePoint(String name) {
byte[] bname = name.getBytes(java.nio.charset.StandardCharsets.ISO_8859_1);
byte[] bname = name.getBytes(sun.nio.cs.ISO_8859_1.INSTANCE);
int hsh = hashN(bname, 0, bname.length);
int idx = hsIndices[(hsh & 0x7fffffff) % hsIndices.length];
while (idx != -1) {