-
Notifications
You must be signed in to change notification settings - Fork 5
Generate equals, hashCode and toString Methods #22
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
Conversation
|
|
||
| ModifiableVariable<?> that = (ModifiableVariable<?>) o; | ||
|
|
||
| return modification != null ? modification.equals(that.modification) : that.modification == null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this really work? Since you did not impelemnt equals methods for the modifications. I also think that you do not need to implement Equals Methods. I think its enough if you compare the "getValue"?
1eebd0b to
a1c7045
Compare
|
I removed the equals Method in ModifiableVariable. |
|
Oh wait my application is broken now ... |
a1c7045 to
f3c9690
Compare
|
Everything should be fine now. There was a equality check of the superclass in every equals Method. |
|
I am still unsure if this is what you want. You are currently checking the OriginalValue, i guess you want getValue? |
f3c9690 to
103f42b
Compare
|
With my implementation both is possible, but you are right, its more logical to use getValue. |
103f42b to
3436bf4
Compare
3436bf4 to
60928f3
Compare
I generate equals methods, which are required to compare ModifiedVariables in a generic way.