diff --git a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/QueueImpl.java b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/QueueImpl.java index 90d424c15e..5fa884b5d1 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/server/impl/QueueImpl.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/server/impl/QueueImpl.java @@ -3122,7 +3122,6 @@ public class QueueImpl implements Queue private class TotalQueueIterator implements LinkedListIterator { LinkedListIterator pageIter = null; - Iterator interIterator = null; LinkedListIterator messagesIterator = null; Iterator lastIterator = null; @@ -3133,7 +3132,6 @@ public class QueueImpl implements Queue { pageIter = pageSubscription.iterator(); } - interIterator = intermediateMessageReferences.iterator(); messagesIterator = new SynchronizedIterator(messageReferences.iterator()); } @@ -3145,11 +3143,6 @@ public class QueueImpl implements Queue lastIterator = messagesIterator; return true; } - if (interIterator.hasNext()) - { - lastIterator = interIterator; - return true; - } if (pageIter != null) { if (pageIter.hasNext()) @@ -3170,11 +3163,6 @@ public class QueueImpl implements Queue MessageReference msg = messagesIterator.next(); return msg; } - if (interIterator.hasNext()) - { - lastIterator = interIterator; - return interIterator.next(); - } if (pageIter != null) { if (pageIter.hasNext())