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

Concrete `Change` classes: implement structural equality #384

Closed
mfulton26 opened this Issue Jun 10, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@mfulton26
Contributor

mfulton26 commented Jun 10, 2016

I'm using JaVers to compare two objects in a test. I have some expected changes that I want to remove from the list of changes but ValueChange et. al. do not override the default hashCode/equals so I can't use convenient List methods like in change.removeAll(expectedChanges) after which I would assert that the list of changes is empty.

I took a look at ValueChange and some other concrete Change classes and from what I can tell GlobalId, Atomic, etc. all override the default hashCode/equals.

Can ValueChange et. al. be updated to also support structural equality instead of referential equality (default hashCode/equals)?

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jun 10, 2016

I think ValueChange could implement equals and hashcode based on left and right values. Diff and all its child objects have to remain immutable. You can came up with a PR if you want.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jun 15, 2016

released in 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment