-
Notifications
You must be signed in to change notification settings - Fork 311
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
Override hashCode() when you override equals() #34
Comments
Patches are welcome :) |
Equal objects must have equal hash codes. There are 11 classes implementing
Eclipse can generate those methods (from the context menu, select "Source - Generate equals and hashCode"). |
mpatric
added a commit
that referenced
this issue
Nov 11, 2013
Issue #34: added missing hashCode() implementations
iNdieboyjeff
pushed a commit
to iNdieboyjeff/mp3agic
that referenced
this issue
Nov 11, 2013
# By Christoph Beck # Via Christoph Beck (1) and Michael Patricios (1) * 'master' of https://github.com/mpatric/mp3agic: added missing hashCode() implementation, fixes mpatric#34
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As Java SDK suggests, you should override hashCode() too when you override equals(). This speeds up your code a bit, and most importantly, your code will not produce compiler warnings.
The text was updated successfully, but these errors were encountered: