fixed some class cast exceptions

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@453171 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-10-05 10:11:17 +00:00
parent ac4beb12f9
commit a3cd7da9c1
1 changed files with 6 additions and 7 deletions

View File

@ -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;
}