-
Notifications
You must be signed in to change notification settings - Fork 75
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
MutableStateFieldCheck: "equalsChanged" misleading #315
Comments
Thanks for reporting this, and thanks for the nice words! I can reproduce the issue as you report it. I agree that this is a bug in EqualsVerifier, and at the moment I can't offer a good workaround. You have a good point that assuming that the two objects are equal before the mutation may not be correct; however, if I make changes based on your suggestions, a whole bunch of other test cases break. I'll have to investigate further. I'll let you know when I have a solution. I can't make any promises about when that will be. I do accept PR's however :) |
Thanks. I don't need a quick fix. I can make use of |
I've just released version 3.4, which fixes this. You'll still need to suppress some |
Up front: I'm dealing with legacy code, which is why my bug report might be a bit esoteric. This popped up when I replaced old/broken code by EqualsVerifier to check another (very simple) exception class.
What steps will reproduce the problem?
Note:
NullPointerException
does not overrideequals
, as such the default==
implementation inObject
is used.What is the code that triggers this problem?
MutableStateFieldCheck.execute
does not check if the two objects were equal before the mutation. The booleanequalsChanged
is wrong in the sense that, in this case, the two instances were not equal before the change, and still are not equal after the change.What error message or stack trace does EqualsVerifier give?
What did you expect?
Test passes
Which version of EqualsVerifier are you using?
3.1.12
Please provide any additional information below.
Thank you for the awesome project!
The text was updated successfully, but these errors were encountered: