From a3cd7da9c1631b8e584c1db670555f0144502b21 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Thu, 5 Oct 2006 10:11:17 +0000 Subject: [PATCH] fixed some class cast exceptions git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@453171 13f79535-47bb-0310-9956-ffa450edef68 --- .../store/kahadaptor/KahaTopicMessageStore.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTopicMessageStore.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTopicMessageStore.java index e3990b411f..9aa8270ff9 100755 --- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTopicMessageStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTopicMessageStore.java @@ -146,8 +146,8 @@ public class KahaTopicMessageStore implements TopicMessageStore{ ListContainer list=(ListContainer) subscriberAcks.get(key); if(list!=null){ for(Iterator i=list.iterator();i.hasNext();){ - TopicSubAck tsa = (TopicSubAck)i.next(); - Object msg=messageContainer.get(tsa.getStoreEntry()); + StoreEntry entry = (StoreEntry)i.next(); + Object msg=messageContainer.get(entry); if(msg!=null){ if(msg.getClass()==String.class){ listener.recoverMessageReference((String) msg); @@ -170,8 +170,8 @@ public class KahaTopicMessageStore implements TopicMessageStore{ boolean startFound=false; int count = 0; for(Iterator i=list.iterator();i.hasNext() && count < maxReturned;){ - TopicSubAck tsa = (TopicSubAck)i.next(); - Object msg=messageContainer.get(tsa.getStoreEntry()); + StoreEntry entry = (StoreEntry)i.next(); + Object msg=messageContainer.get(entry); if(msg!=null){ if(msg.getClass()==String.class){ String ref=msg.toString(); @@ -226,9 +226,8 @@ public class KahaTopicMessageStore implements TopicMessageStore{ public Message getNextMessageToDeliver(String clientId,String subscriptionName) throws IOException{ String key=getSubscriptionKey(clientId,subscriptionName); ListContainer list=(ListContainer) subscriberAcks.get(key); - Iterator iter = list.iterator(); - TopicSubAck tsa = (TopicSubAck)list.get(0); - Message msg=(Message)messageContainer.get(tsa.getStoreEntry()); + StoreEntry entry = (StoreEntry)list.get(0); + Message msg=(Message)messageContainer.get(entry); return msg; }