Skip to content
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

Mapbackeds: Consider introducing an equalsMethod that treats arrays with same values as equal. #70

Open
kaifox opened this issue Oct 17, 2022 · 0 comments

Comments

@kaifox
Copy link
Member

kaifox commented Oct 17, 2022

Currently, the mapbacked objects use the equals method of the underlying map.

If consequently uing collections below, everything is fine for data objects. However, if fields are declared as arrays, then two arrays are treated as not equal, even if they contain the same values....

Most probably this should be changed, as for domain objects, which even can be serialized and deserialized, these different instances should be equal, or? However this would require a big if/else and some reflective acrobatic, because of all the primitives ... or is there a simpler solution? Or should it not be changed at all?

The problem is highlighted in
https://github.com/ossgang/ossgang-commons/blob/master/src/test/java/org/ossgang/commons/mapbackeds/ArrayFieldEqualsTest.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant