On Fri, 23 May 2025 20:37:05 GMT, Andrey Turbanov <aturba...@openjdk.org> wrote:

>> Tagir F. Valeev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Make min and max generic
>
> src/java.base/share/classes/java/util/Comparator.java line 200:
> 
>> 198:      * @param   <U> the type of the arguments and the result.
>> 199:      * @return  the larger of {@code a} and {@code b} according to this 
>> comparator.
>> 200:      * @throws  ClassCastException if the collection contains elements 
>> that are
> 
> What 'collection' meaned here?

Good catch, thank you. The description was copied from `Collections::max`, 
which is not so appropriate here. I think it's better to copy it from 
`Comparator::compare` (also, added `@throws NPE` for consistency).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25297#discussion_r2105747341

Reply via email to