8343962: [REDO] Move getChars to DecimalDigits

Reviewed-by: redestad, rgiulietti
This commit is contained in:
Shaojin Wen 2025-01-25 03:12:56 +00:00
parent 7c0985fc32
commit f446cefee0
12 changed files with 409 additions and 382 deletions

View file

@ -23,6 +23,8 @@
package java.lang;
import jdk.internal.util.DecimalDigits;
/**
* A helper class to get access to package-private members
*/
@ -117,11 +119,17 @@ public class Helper {
}
public static int getChars(int i, int begin, int end, byte[] value) {
return StringUTF16.getChars(i, begin, end, value);
StringUTF16.checkBoundsBeginEnd(begin, end, value);
int pos = DecimalDigits.getCharsUTF16(i, end, value);
assert begin == pos;
return pos;
}
public static int getChars(long l, int begin, int end, byte[] value) {
return StringUTF16.getChars(l, begin, end, value);
StringUTF16.checkBoundsBeginEnd(begin, end, value);
int pos = DecimalDigits.getCharsUTF16(l, end, value);
assert begin == pos;
return pos;
}
public static boolean contentEquals(byte[] v1, byte[] v2, int len) {