This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.11 by this push:
     new ece16841132 [fix][client][branch-2.11] Fix cherry-picking issue in 
#22393, address SpotBugs failure
ece16841132 is described below

commit ece16841132f0f3832e14a68d73dfdf49f9b45ca
Author: Lari Hotari <[email protected]>
AuthorDate: Wed Apr 17 19:57:29 2024 +0300

    [fix][client][branch-2.11] Fix cherry-picking issue in #22393, address 
SpotBugs failure
    
    - SpotBugs check failed since there was an unused field "msgSize"
      - remove the unused field in branch-2.11
---
 .../src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java  | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 829eb9a680b..da2cecda1bc 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -334,8 +334,7 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
             interceptorMessage.getProperties();
         }
 
-        int msgSize = interceptorMessage.getDataBuffer().readableBytes();
-        sendAsync(interceptorMessage, new DefaultSendMessageCallback(future, 
interceptorMessage, msgSize));
+        sendAsync(interceptorMessage, new DefaultSendMessageCallback(future, 
interceptorMessage));
         return future;
     }
 
@@ -343,15 +342,13 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
 
         CompletableFuture<MessageId> sendFuture;
         MessageImpl<?> currentMsg;
-        int msgSize;
         long createdAt = System.nanoTime();
         SendCallback nextCallback = null;
         MessageImpl<?> nextMsg = null;
 
-        DefaultSendMessageCallback(CompletableFuture<MessageId> sendFuture, 
MessageImpl<?> currentMsg, int msgSize) {
+        DefaultSendMessageCallback(CompletableFuture<MessageId> sendFuture, 
MessageImpl<?> currentMsg) {
             this.sendFuture = sendFuture;
             this.currentMsg = currentMsg;
-            this.msgSize = msgSize;
         }
 
         @Override

Reply via email to