| [SOLVED] generated equals missing not null check [message #958879] |
Fri, 26 October 2012 05:34  |
Andre Albert Messages: 25 Registered: July 2009 |
Junior Member |
|
|
Hello,
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
[Updated on: Fri, 26 October 2012 07:11] Report message to a moderator
|
|
|
| Re: generated equals missing not null check [message #958988 is a reply to message #958879] |
Fri, 26 October 2012 07:11  |
Andre Albert Messages: 25 Registered: July 2009 |
Junior Member |
|
|
Solved:
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
|
|
|
Powered by
FUDForum. Page generated in 0.01612 seconds