activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r550389 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
Date Mon, 25 Jun 2007 06:57:36 GMT
Author: jstrachan
Date: Sun Jun 24 23:57:35 2007
New Revision: 550389

URL: http://svn.apache.org/viewvc?view=rev&rev=550389
Log:
applied patch for issue: http://www.nabble.com/Performance-problem-in-ActiveMQ4.2-SNAPSHOT-tf3973867s2354.html#a11280202

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java?view=diff&rev=550389&r1=550388&r2=550389
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
Sun Jun 24 23:57:35 2007
@@ -74,10 +74,11 @@
 
     public String getText() throws JMSException {
         if (text == null && getContent() != null) {
+            InputStream is = null;
             try {
                 ByteSequence bodyAsBytes = getContent();
                 if (bodyAsBytes != null) {
-                    InputStream is = new ByteArrayInputStream(bodyAsBytes);
+                    is = new ByteArrayInputStream(bodyAsBytes);
                     if( isCompressed() ) {
                         is = new InflaterInputStream(is);
                     }
@@ -88,6 +89,16 @@
                 }
             } catch (IOException ioe) {
                 throw JMSExceptionSupport.create(ioe);
+            }
+            finally {
+                if (is != null) {
+                    try {
+                        is.close();
+                    }
+                    catch (IOException e) {
+                        // ignore
+                    }
+                }
             }
         }
         return text;



Mime
View raw message