Ignore NULL references when checking isEmpty

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@581568 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-10-03 11:24:38 +00:00
parent 69a5e00843
commit 5bd3bf6e24
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package org.apache.activemq.broker.region.cursors;
import java.util.Iterator;
import java.util.LinkedList;
import org.apache.activemq.broker.region.MessageReference;
import org.apache.activemq.broker.region.QueueMessageReference;
/**
* hold pending messages in a linked list (messages awaiting disptach to a
@ -40,6 +41,9 @@ public class VMPendingMessageCursor extends AbstractPendingMessageCursor {
} else {
for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
MessageReference node = iterator.next();
if (node== QueueMessageReference.NULL_MESSAGE){
continue;
}
if (!node.isDropped()) {
return false;
}