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/08/09 12:52:11 UTC

[GitHub] [pulsar] leizhiyuan commented on a change in pull request #11607: Fix null MessageId may be passed to its compareTo() method

leizhiyuan commented on a change in pull request #11607:
URL: https://github.com/apache/pulsar/pull/11607#discussion_r685164858



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
##########
@@ -115,10 +115,11 @@ public PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, Consum
      */
     @Override
     public boolean isDuplicate(@NonNull MessageId messageId) {
-        if (lastCumulativeAck.messageId == null) {
+        final MessageId messageIdOfLastAck = lastCumulativeAck.messageId;

Review comment:
       messageId is an reference Type. 
   
   if you changed lastCumulativeAck.messageId to null, messageIdOfLastAck also will be null.
   




-- 
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: commits-unsubscribe@pulsar.apache.org

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