From dade72905bb754f5488f8c5e160959709a51045b Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Mon, 19 Jan 2015 16:49:02 +0000 Subject: [PATCH] ACTIVEMQ6-71 - fix duplicates in TotalQueueIterator https://issues.apache.org/jira/browse/ACTIVEMQ6-71 remove the intermediateReference iterator as these may be moved anyway --- .../apache/activemq/core/server/impl/QueueImpl.java | 12 ------------ 1 file changed, 12 deletions(-) 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())