RFR: 8027470: AnnotationSupport uses == rather than .equals to compare Class objects
joe.darcy at oracle.com
Fri Nov 15 03:21:38 UTC 2013
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
On 10/31/2013 3:24 AM, David Holmes wrote:
> Hi Andreas,
> On 31/10/2013 7:49 PM, Andreas Lundblad wrote:
>> Please review the fix for JDK-8027470 below.
>> 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.
>> Link to web review:
>> Link to bug reports:
>> -- Andreas Lundblad
More information about the core-libs-dev