activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r692172 - /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java
Date Thu, 04 Sep 2008 17:46:51 GMT
Author: rajdavies
Date: Thu Sep  4 10:46:51 2008
New Revision: 692172

URL: http://svn.apache.org/viewvc?rev=692172&view=rev
Log:
patch for https://issues.apache.org/activemq/browse/AMQ-1898

Modified:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java?rev=692172&r1=692171&r2=692172&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java (original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java Thu
Sep  4 10:46:51 2008
@@ -24,6 +24,7 @@
 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 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 @@
                         break;
                     }
                 }
+                tempBrowser.close();
             }
 
         }



Mime
View raw message