gemmellr commented on code in PR #4840:
URL: https://github.com/apache/activemq-artemis/pull/4840#discussion_r1514790848


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageReader.java:
##########
@@ -50,14 +50,15 @@ public DeliveryAnnotations getDeliveryAnnotations() {
    @Override
    public void close() {
       if (!closed) {
-         if (currentMessage != null) {
-            try {
-               currentMessage.deleteFile();
-            } catch (Throwable error) {
-               
ActiveMQServerLogger.LOGGER.errorDeletingLargeMessageFile(error);
-            } finally {
-               currentMessage = null;
+         try {
+            AMQPLargeMessage localCurrentMessage = currentMessage;

Review Comment:
   > There was actually only addBytes... as the initialization should stay as 
is.
   > 
   > I amended the PR with the addBytes change.
   
   readBytes also reads (and writes) the variable multiple times.



-- 
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: gitbox-unsubscr...@activemq.apache.org

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

Reply via email to