Skip to content

Conversation

@copybara-service
Copy link
Contributor

Use Character.charCount.

I don't see any discussion of why we didn't use this back in cl/8202370. It was added to Java in Java 1.5, just like the isSupplementaryCodePoint method that we've been using instead. Android has had it since 1.0 (though this code predates Android 1.0 by two weeks!), so there's no concern there. We didn't even expose the code to GWT at that point, either.

RELNOTES=n/a

I don't see any discussion of why we didn't use this back in cl/8202370. It was added to Java [in Java 1.5](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Character.html#charCount(int)), just like [the `isSupplementaryCodePoint` method](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Character.html#isSupplementaryCodePoint(int)) that we've been using instead. Android has had it [since 1.0](https://developer.android.com/reference/java/lang/Character#charCount(int)) (though this code predates Android 1.0 by two weeks!), so there's no concern there. We didn't even expose the code to GWT at that point, either.

RELNOTES=n/a
PiperOrigin-RevId: 860359073
@copybara-service copybara-service bot merged commit 53d1de0 into master Jan 24, 2026
@copybara-service copybara-service bot deleted the test_860145053 branch January 24, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant