Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
OrderedTuple#hashCode() is as follows:
public int hashCode() { return Arrays.hashCode(components) ^ ((Integer) offset).hashCode() ^ ((Integer) lsb).hashCode() ^ ((Boolean) posInf).hashCode() ^ ((Boolean) negInf).hashCode() ^ ((Boolean) nan).hashCode(); }
This is not the correct way to convert primitives to their object equivalents.
((Integer) x).hashCode() == x Boolean#hashCode() is defined as value ? 1231 : 1237
Note that this error won't be found unless the compiler emits warnings for boxing.
OrderedTuple#hashCode() is as follows: public int hashCode() { return Arrays.hashCode(components) ^ (( Integer ) offset).hashCode() ^ (( Integer ) lsb).hashCode() ^ (( Boolean ) posInf).hashCode() ^ (( Boolean ) negInf).hashCode() ^ (( Boolean ) nan).hashCode(); } This is not the correct way to convert primitives to their object equivalents. (( Integer ) x).hashCode() == x Boolean #hashCode() is defined as value ? 1231 : 1237 Note that this error won't be found unless the compiler emits warnings for boxing.