Hello,

Catching up on email, the specification of java.lang.Class does not explicitly promise that its notion of equality must be identity for all time. Therefore, while not required for today's implementations, I would prefer that new code we write in the JDK use equals rather than == when comparing classes.

Cheers,

-Joe

On 10/31/2013 3:24 AM, David Holmes wrote:
Hi Andreas,

On 31/10/2013 7:49 PM, Andreas Lundblad wrote:
Hi,

Please review the fix for JDK-8027470 below.

Description:
AnnotationSupport compared Class-instances using '==' where it should be using '.equals'. Fixed in this patch.

Class is final and does not override Object.equals therefore it is guaranteed to be based on identity. This change, while harmless, is unnecessary. Comparison of Class instances with == occurs throughout the JDK.

David
-----

Link to web review:
http://cr.openjdk.java.net/~alundblad/8027470

Link to bug reports:
http://bugs.openjdk.java.net/browse/JDK-8027470

-- Andreas Lundblad


Reply via email to