On Wed, 27 Aug 2025 23:18:11 GMT, Chen Liang <li...@openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - Improve "sneaky throws"
>>  - Improve comment style
>
> src/java.base/share/classes/java/lang/String.java line 890:
> 
>> 888: 
>> 889:     private static <E extends Exception> byte[] encodeWithEncoder(
>> 890:             Charset cs, byte coder, byte[] val, Class<E> exceptionClass)
> 
> Since `exceptionClass` is a dummy argument that can't actually control the 
> type of exception thrown by this method, that it being null or not is the 
> only thing that matters, I recommend documenting/commenting about this fact, 
> as this is otherwise potentially confusing. Maybe a name to indicate this 
> nature (I came up with `replacementSwitch` but this is for sure horrible) 
> would help too I guess?

I think you have a point – I've improved the docs in fa46a81bdc2.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2307007890

Reply via email to