Improve consistency of equality between objects
Opened this issue · 0 comments
cmoesel commented
In the current implementation, equality of data types (e.g., Quantity, Date, DateTime, etc) can be determined in multiple ways:
a.equals(b)
b.equals(a)
equals(a, b)
(and perhaps alsoequals(b, a)
)
When PR #278 is merged, it will introduce another way:
Immutable.is(a, b)
The results of these operations may differ depending on which one you call and which data types are passed in. This should not be the case, as all equality operations should be consistent and commutative. Ideally, they should all be backed by the same implementation.
For additional discussion, see: #278 (comment).