Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [SOLVED] generated equals missing not null check
[SOLVED] generated equals missing not null check [message #958879] Fri, 26 October 2012 09:34 Go to next message
Andre Albert is currently offline Andre AlbertFriend
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 11: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 11:11 Go to previous message
Andre Albert is currently offline Andre AlbertFriend
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
Previous Topic:JDBC Connection for Java ( IBM Data Studio )
Next Topic:How to find out how is Tomcat started in Eclipse?
Goto Forum:
  


Current Time: Fri Apr 19 03:22:40 GMT 2024

Powered by FUDForum. Page generated in 0.02773 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top