--- old/src/java.base/share/classes/java/lang/StringCoding.java 2017-03-15 17:01:57.178056419 -0400 +++ new/src/java.base/share/classes/java/lang/StringCoding.java 2017-03-15 17:01:55.765974769 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, 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 @@ -428,7 +428,7 @@ byte[] da, int dp, int len) { int i = 0; for (; i < len; i++) { - char c = StringUTF16.getChar(sa, sp++); + char c = StringUTF16.Trusted.getChar(sa, sp++); if (c > '\u00FF') break; da[dp++] = (byte)c; @@ -450,9 +450,9 @@ sp = sp + ret; dp = dp + ret; if (ret != len) { - char c = StringUTF16.getChar(val, sp++); + char c = StringUTF16.Trusted.getChar(val, sp++); if (Character.isHighSurrogate(c) && sp < sl && - Character.isLowSurrogate(StringUTF16.getChar(val, sp))) { + Character.isLowSurrogate(StringUTF16.Trusted.getChar(val, sp))) { sp++; } dst[dp++] = '?'; @@ -481,13 +481,13 @@ byte[] dst = new byte[len]; int dp = 0; for (int i = 0; i < len; i++) { - char c = StringUTF16.getChar(val, i); + char c = StringUTF16.Trusted.getChar(val, i); if (c < 0x80) { dst[dp++] = (byte)c; continue; } if (Character.isHighSurrogate(c) && i + 1 < len && - Character.isLowSurrogate(StringUTF16.getChar(val, i + 1))) { + Character.isLowSurrogate(StringUTF16.Trusted.getChar(val, i + 1))) { i++; } dst[dp++] = '?'; @@ -517,13 +517,13 @@ int sl = val.length >> 1; dst = new byte[sl * 3]; char c; - while (sp < sl && (c = StringUTF16.getChar(val, sp)) < '\u0080') { + while (sp < sl && (c = StringUTF16.Trusted.getChar(val, sp)) < '\u0080') { // ascii fast loop; dst[dp++] = (byte)c; sp++; } while (sp < sl) { - c = StringUTF16.getChar(val, sp++); + c = StringUTF16.Trusted.getChar(val, sp++); if (c < 0x80) { dst[dp++] = (byte)c; } else if (c < 0x800) { @@ -533,7 +533,7 @@ int uc = -1; char c2; if (Character.isHighSurrogate(c) && sp < sl && - Character.isLowSurrogate(c2 = StringUTF16.getChar(val, sp))) { + Character.isLowSurrogate(c2 = StringUTF16.Trusted.getChar(val, sp))) { uc = Character.toCodePoint(c, c2); } if (uc < 0) {