RFR 8009736: Comparator API cleanup

Paul Sandoz paul.sandoz at oracle.com
Fri Jun 14 03:58:42 PDT 2013


On Jun 14, 2013, at 12:37 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>> FWIW i find this marginally clearer:
>> 
>>         NullComparator(boolean nullsFirst, Comparator<? super T> real) {
>>             this(nullsFirst ? -1 : 1, real);
>>         }
>> 
>>         private NullComparator(int sign, Comparator<? super T> real) {
>>             this.sign = sign;
>>             this.real = (Comparator<T>) Objects.requireNonNull(real);
>>         }
>> 
>> but it's just nit-picking.
> 
> and why the NullComparator is specified as a class an not as a 
> serializable lambda

It also overrides some default methods of Comparator.

Paul.


More information about the lambda-dev mailing list