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

DefaultRecord Equality and Hash #196

Open
vjkoskela opened this issue May 29, 2020 · 0 comments
Open

DefaultRecord Equality and Hash #196

vjkoskela opened this issue May 29, 2020 · 0 comments

Comments

@vjkoskela
Copy link
Member

The DefaultRecord implementation compares and hashes only based on its id field. Two records could have the same id but different contents (a violation of the contract mind you) but still be considered the same.

In my opinion this is unexpected. The built-in equality and hash for a POJO should do the normal expected field-by-field comparison. And if special places in the code (e.g. record deduplication) need to perform hash-by id or equality by id they should do so explicitly.

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