RFR (2nd round) 8009736: Comparator API cleanup
Henry Jen
henry.jen at oracle.com
Thu Jun 20 16:40:32 PDT 2013
On 06/20/2013 03:45 PM, Michael Hixson wrote:
> + return new NullComparator(nullFirst, real == null ? null :
> real.thenComparing(other));
>
> Should that be "other" instead of the second "null", like this?
>
> + return new NullComparator(nullFirst, real == null ? other :
> real.thenComparing(other));
>
> Also, if Comparator.nullsFirst(null) and nullsLast(null) no longer
> throw, I think it's worth mentioning what their behavior is in the
> javadocs. My suggestion:
>
> "If the specified comparator is {@code null}, then the returned
> comparator considers all non-null values to be equal."
>
You are right on both, both fixed and added extra test.
http://hg.openjdk.java.net/lambda/lambda/jdk/rev/197698000f78
webrev updated.
Cheers,
Henry
More information about the lambda-dev
mailing list