Closed Marcono1234 closed 5 years ago
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: