O'Reilly logo
  • Doug DesCombaz thinks this is interesting:

Thus, the implementation of compareTo() in AbstractChannel throws an Error if two distinct Channel instances return the same hash code.


Cover of Netty in Action


That's not true. It never checks the hashCode. It checks the instance, and then the id. The implementation of ChannelId.compareTo() return 0 in the DefaultChannelId implementation, and EmbeddedChannelId it compares the long text value.