java.util.Objects.equals() fails to compile with static import
Rémi Forax
forax at univ-mlv.fr
Sun Nov 7 10:35:32 UTC 2010
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
More information about the core-libs-dev
mailing list