You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/03/21 13:26:02 UTC

[GitHub] [kafka] dajac commented on a change in pull request #11900: MINOR: Fix class comparison in `AlterConfigPolicy.RequestMetadata.equals()`

dajac commented on a change in pull request #11900:
URL: https://github.com/apache/kafka/pull/11900#discussion_r831102681



##########
File path: clients/src/main/java/org/apache/kafka/server/policy/AlterConfigPolicy.java
##########
@@ -71,7 +71,7 @@ public int hashCode() {
 
         @Override
         public boolean equals(Object o) {
-            if (o == null || o.getClass() != o.getClass()) return false;
+            if ((o == null) || (!o.getClass().equals(getClass()))) return false;

Review comment:
       I don't feel strong about the `!=` vs. `equals`. We can keep it as you did it. However, I just took the liberty to push a small unit test to your branch. I hope you don't mind.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org