Comparators.reverseOrder issues

Remi Forax forax at univ-mlv.fr
Mon Oct 29 07:08:32 PDT 2012


On 10/29/2012 12:10 PM, Paul Sandoz wrote:
> Hi Georgiy,
>
> Brian fixed 1) recently:
>
>    http://hg.openjdk.java.net/lambda/lambda/jdk/rev/f6366de3394c
>
> Although arguably that could break compatibility with existing source and implementations that somehow worked around the CCE.
>
> For 2) i am not sure what can be done, i think we are stuck with it.

For 2), I think reverseOrder(null) should throw a NPE, if the comparator 
is null.

Note that now that we have default method, reverseOrder() should not be 
declared in Comparators
but should be a default method of Comparator.

Moreover when the compiler will accept to declare static methods in 
interface,
(I've not tested if it is already Ok) the classes Comparators, 
Predicates etc. should be removed
and all the implementations should be moved in the corresponding interfaces.

>
> Paul.

Rémi

>
> On Oct 29, 2012, at 11:31 AM, Georgiy Rakov <georgiy.rakov at oracle.com> wrote:
>
>> Hello colleagues,
>> could you please give your thoughts and comments. Do you consider it
>> worth taking into account?
>>
>> Thanks, Georgiy.



More information about the lambda-dev mailing list