RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface [v4]
Tagir F. Valeev
tvaleev at openjdk.org
Sat May 24 07:34:40 UTC 2025
On Fri, 23 May 2025 18:57:45 GMT, Roger Riggs <rriggs at 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 206:
>
>> 204: * @since 25
>> 205: */
>> 206: default <U extends T> U max(U a, U b) {
>
> The parameter names are o1 and o2 in the `compare` method min and max build on.
> Though a and b are used in the class javadoc example and x and y are used in the spec description.
> Can we be consistent in the API? (o1, o2) perhaps. Someday, the parameter names *may* be more significant.
Done, thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25297#discussion_r2105746862
More information about the core-libs-dev
mailing list