This allows us to verify all the properties we wish to hold w.r.t. 
equals/hashCode.

Most of them are required by either the Java spec or by common sense:
https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)
https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()

The one "extra" requirement is that inequal objects should have different 
hashcodes. The spec specifically says this is allowed, but it will cause poor 
map/set performance, since they will be guaranteed to collide and wind up 
creating linked lists.
Since we're only validating our own implementations, it's ok to insist on this 
property.

[ Full content available at: https://github.com/apache/kafka/pull/5536 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to