java.util.Objects.equals() fails to compile with static import

Arul Dhesiaseelan aruld at acm.org
Sun Nov 7 16:52:59 UTC 2010


I stand corrected. Thanks Remi.

On Sun, Nov 7, 2010 at 3:35 AM, Rémi Forax <forax at univ-mlv.fr> wrote:

> Le 07/11/2010 07:03, Arul Dhesiaseelan a écrit :
>
>  Hello,
>>
>> Sorry, if I am posting to the wrong mailing list. It looks the
>> java.util.Objects proposal was originally discussed in this forum. I have a
>> related question about the implementation. I was playing with the
>> java.util.Objects API in the recent JDK 7 build (b117) and it looks like the
>> equals() method fails to compile if I statically import it, with the
>> following error:
>>
>> method equals in class Object cannot be applied to given types;
>>
>> It clashes with java.lang.Object's equals() method. I am not sure if this
>> a known limitation or a bug.
>>
>> -Arul
>>
>
> It's a known limitation of the static import feature.
>
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20101107/cd6ff06a/attachment.html>


More information about the core-libs-dev mailing list