From a810f4300a9acdcf981a4409f56858564929a4c9 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Sun, 31 Dec 2006 17:32:40 +0000 Subject: [PATCH] Fix RecoveryBrokerTest that I messed up :) git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@491452 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/region/cursors/TopicStorePrefetch.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java index 286c0cec2a..1e6922b005 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/TopicStorePrefetch.java @@ -48,7 +48,7 @@ class TopicStorePrefetch extends AbstractPendingMessageCursor implements private String subscriberName; private Destination regionDestination; - boolean empty=true; + boolean empty; private MessageId firstMessageId; private MessageId lastMessageId; @@ -65,7 +65,16 @@ class TopicStorePrefetch extends AbstractPendingMessageCursor implements this.subscriberName=subscriberName; } - public void start() throws Exception{ + public void start() throws Exception { + if(batchList.isEmpty()){ + try{ + fillBatch(); + }catch(Exception e){ + log.error("Failed to fill batch",e); + throw new RuntimeException(e); + } + empty = batchList.isEmpty(); + } } public void stop() throws Exception{