gharris1727 commented on PR #14398: URL: https://github.com/apache/kafka/pull/14398#issuecomment-1725812032
> I was initially concerned with the discrepancy in the implementations of the compareTo and equals methods in the PluginDesc class and wondered if this could lead to other unexpected issues or bugs in the future. However, it looks like the contract for [Comparable::compareTo](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Comparable.html#compareTo(T)) does allow for such a discrepancy: I don't believe we have this discrepancy, and don't need this caveat. Because PluginDesc::equals is using klass.equals, and PluginDesc::compareTo is using name.compareTo and location.compareTo, they should be consistent. We can change the equals method to use name.equals and location.equals to make it more obvious, but that would be mostly a readability change. (The same class name but loaded from different classloaders produces Class objects where equals is false). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org