You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The NBT classes implement equals, but not hashCode. The java-doc says that both should be implemented:
Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
The text was updated successfully, but these errors were encountered:
You're right, here's a pull request that fixes this: #17
equals() works by actually checking all keys and values, this means hashCode() needs to do the same to comply with the java-doc (which might cause some performance issues when used on huge NBT structures).
The implementation of hashCode() does currently not affect the NBT implementation, because the only thing that calculates hash codes is the CompoundTag which is using a HashMap which in turn only ever has Strings as keys, not Tags.
The NBT classes implement
equals
, but nothashCode
. The java-doc says that both should be implemented:The text was updated successfully, but these errors were encountered: