From 9af51fc7d0723b1fba675b7de5c47ecc6f2c47ae Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Tue, 27 Jan 2026 19:55:55 +0900 Subject: [PATCH] Remove `Character.codePointCount` overload --- .../share/classes/java/lang/Character.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index 43d61011c49..1a45022a984 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -9952,28 +9952,6 @@ class Character implements java.io.Serializable, Comparable, 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