RFR: 8372353: API to compute the byte length of a String encoded in a given Charset [v4]

Liam Miller-Cushon cushon at openjdk.org
Thu Jan 15 14:42:35 UTC 2026


On Thu, 15 Jan 2026 13:49:54 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> There should also be a test of the API basics in the test/jdk/java/lang/String directory including NullPointerException.

Thanks, I added test coverage of `NullPointerException` to `test/jdk/java/lang/String/Exceptions.java`. There is also an assertion in `test/jdk/java/lang/String/Encodings.java` to ensure it matches `getBytes(...).length`. Is there additional API test coverage that should be added to `test/jdk/java/lang/String/`?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28454#issuecomment-3755197805


More information about the core-libs-dev mailing list