clebertsuconic commented on a change in pull request #3911:
URL: https://github.com/apache/activemq-artemis/pull/3911#discussion_r782554568



##########
File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
##########
@@ -710,10 +710,8 @@ public void clear(boolean waitForOnMessage) throws 
ActiveMQException {
       synchronized (this) {
          // Need to send credits for the messages in the buffer
 
-         Iterator<ClientMessageInternal> iter = buffer.iterator();
-
-         while (iter.hasNext()) {
-            try {
+         try (LinkedListIterator<ClientMessageInternal> iter = 
buffer.iterator()) {

Review comment:
       Funny! I had the exact same fix on my laptop ready to send a PR for :) 
   
   if I merge your PR, it won't even show a difference




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to