You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/16 23:46:38 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #8980: Add equals, hashCode methods to all Authentication implementation class

merlimat commented on a change in pull request #8980:
URL: https://github.com/apache/pulsar/pull/8980#discussion_r544704724



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/AuthenticationToken.java
##########
@@ -98,4 +100,23 @@ public void start() throws PulsarClientException {
         // noop
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof AuthenticationToken)) {
+            return false;
+        }
+        AuthenticationToken that = (AuthenticationToken) o;
+        if (tokenSupplier == that.tokenSupplier){
+            return true;
+        }
+        return Objects.equals(tokenSupplier.get(), that.tokenSupplier.get());

Review comment:
       This does not look correct. The same supplier is allowed to give each time a different token.




----------------------------------------------------------------
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.

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