git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@692172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-09-04 17:46:51 +00:00
parent 3e2b3d25fe
commit 512ca88ba6
1 changed files with 4 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.QueueBrowser;
import javax.jms.TextMessage;
/**
@ -55,7 +56,8 @@ public class MessageQuery extends QueueBrowseQuery {
public Message getMessage() throws JMSException {
if (message == null) {
if (id != null) {
Enumeration iter = getBrowser().getEnumeration();
QueueBrowser tempBrowser=getBrowser();
Enumeration iter = tempBrowser.getEnumeration();
while (iter.hasMoreElements()) {
Message item = (Message) iter.nextElement();
if (id.equals(item.getJMSMessageID())) {
@ -63,6 +65,7 @@ public class MessageQuery extends QueueBrowseQuery {
break;
}
}
tempBrowser.close();
}
}