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 2021/01/06 04:17:33 UTC

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

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



##########
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:
       Your suggestion is correct, I will modify the content here.




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