On 23.04.16 4:59, Jim Graham wrote:
So, I'd recommend that CM.equals() tests getClass() == getClass() at the
base level and then all others will use super.equals() and get the same
protection. It means you can't have a subclass of CCM be "equals" to a
different subclass of CCM, but that's an unfortunate issue with equals
needing to honor symmetry... :(
Small note. In this case the custom classes which do not provide the new
state, cannot compares to parent class because of "class==class" check.
I guess this is behavior change, but I am not sure should we document
that or not.
...jim
On 4/20/2016 10:17 AM, Phil Race wrote:
Hi, You removed the following test in CCM.java : 2941 if (obj.getClass()
!= getClass()) {
2942 return false;
2943 }
What this means is that before your change an instance of a subclass
of CCM
would never be equals() to any direct instantiatation of CCM but after
your change it can be. I suspect the condition was there on purpose.
-phil.
On 04/20/2016 05:45 AM, Jayathirth D V wrote:
Hi,
_Please review the following fix in JDK9:_
Bug : https://bugs.openjdk.java.net/browse/JDK-8153943
This is subtask of https://bugs.openjdk.java.net/browse/JDK-6588409
Webrev : http://cr.openjdk.java.net/~jdv/8153943/webrev.00/
<http://cr.openjdk.java.net/%7Ejdv/8153943/webrev.00/>
Issue : Some of the java.awt.image classes are missing either equals()
or hashCode() method.
Solution : Add missing equals() or hashCode() methods.
Thanks,
Jay
--
Best regards, Sergey.