-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect code if grandparent class overrides equals(Object) / hashCode() #13
Comments
Fixed in v. 1.0.9 |
Thanks for the prompt fix! Regards, From: Michal Jedynak [mailto:notifications@github.com] Fixed in v. 1.0.9 — |
Thanks ! |
It still generates a faulty equals method: It doesn't use the instanceOf and it doesn't do super.equals() in the return statement |
The 'equals' method is generated according to http://www.technofundo.com/tech/java/equalhash.html, which describes why '(obj == null || getClass() != obj.getClass())' should be used instead of 'instanceOf'. |
Hi,
the plugin adds calls super.equals(obj) and super.hashCode(), respctively, if the parent class has its own implementation of these methods (and the parent class is not java.lang.Object).
However, the plugin fails to call super.equals(obj) and super.hashCode() if these were overriden in a class further up in the hierarchy. The code in https://dl.dropboxusercontent.com/u/1675887/OverridenEqualsHashCode.zip demonstrates this issue:
Regards
Christoph
The text was updated successfully, but these errors were encountered: