Skip to content

DefaultRecord Equality and Hash #196

@vjkoskela

Description

@vjkoskela

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions