Remove Character.codePointCount overload

This commit is contained in:
Tatsunori Uchino 2026-01-27 19:55:55 +09:00 committed by GitHub
parent 6d2805d358
commit 9af51fc7d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9952,28 +9952,6 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
return n;
}
/**
* Returns the number of Unicode code points in the text range of
* the specified char sequence. Unpaired surrogates count as one
* code point each.
*
* @param seq the char sequence
* @return the number of Unicode code points in the char sequence
* @throws NullPointerException if {@code seq} is null.
* @since 26
*/
public static int codePointCount(CharSequence seq) {
final int length = seq.length();
int n = length;
for (int i = 0; i < length; ) {
if (isHighSurrogate(seq.charAt(i++)) && i < length &&
isLowSurrogate(seq.charAt(i))) {
n--;
i++;
}
}
return n;
}
/**
* Returns the number of Unicode code points in a subarray of the