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

Arul Dhesiaseelan aruld at acm.org
Sun Nov 7 06:03:28 UTC 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20101107/0839dc94/attachment.html>


More information about the core-libs-dev mailing list