On Thu, 15 Jan 2026 17:27:11 GMT, Roger Riggs <[email protected]> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Deduplicate with computeSizeUTF8_UTF16
>
> src/java.base/share/classes/java/lang/String.java line 1498:
> 
>> 1496:             if (length > (long)Integer.MAX_VALUE) {
>> 1497:                 throw new IllegalStateException("Required length 
>> exceeds implementation limit");
>> 1498:             }
> 
> This is more like a should never reach here; the OOME thrown by 
> encodedLengthUTF8_UTF16 should ocur.
> IllegalStateException usually refers to a programming error.
> The other occurrence like this throws OOME.

Thanks, what do you think about refactoring the OOME into 
`encodedLengthUTF8_UTF16` and having it return `int`?

> src/java.base/share/classes/java/lang/String.java line 2112:
> 
>> 2110:      *
>> 2111:      * @param cs The {@link Charset} used to the compute the length
>> 2112:      * @throws NullPointerException If {@code cs} is {@code null}
> 
> @throws clauses for NPE are usually omitted, the class javadoc specifies the 
> behavior for the whole class.

Removed, thanks

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28454#discussion_r2695393117
PR Review Comment: https://git.openjdk.org/jdk/pull/28454#discussion_r2695393824

Reply via email to