Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[SOLVED] generated equals missing not null check
https://www.eclipse.org/forums/index.php/mv/msg/415918/958879/#msg_958879
I am asking myself why the not-null-check previously used in the generated equals method is gone. The equals contract (java.lang.Object JavaDoc) says that "For any non-null reference value x, x.equals(null) should return false."
But now, I get a NullPointerException. Also, the generated hashCode method still uses the not-null-check.
Is there any reason for this switch. It looks like this switch was made between Indigo ServiceRelease 1 and ServiceRelease 2 - It is also part in Juno.
Regards]]>Andre Albert2012-10-26T09:34:46-00:00Re: generated equals missing not null check
https://www.eclipse.org/forums/index.php/mv/msg/415918/958988/#msg_958988
Eclipse seems to check if superclass directly extends from Object or no superclass redefines hashCode/equals from Object.
In my scenario, the problem was that i removed hash/equals from my custom superclass but then, did not regenerate hash/equals from all its subclasses]]>Andre Albert2012-10-26T11:11:08-00:00