Broken equals/hashcode contract for Quantity class
Closed this issue · 1 comments
Passarinho4 commented
Hi!
There is a very serious bug in Quantity class. There is broken contract for hashcode/equals methods.
Example:
5 hours is equal to 18000000 milliseconds, but (5 hours).hashCode == 50364223 and (18000000 milliseconds).hashCode == -1789482435.
Quick fix -> change hashCode() method implementation in Quantity class to dimension.hashCode().
This bug has many consequences, but I think they are obvious :)
What do you think? #307
cquiroz commented
Sounds like a serious bug. Would you send a PR?