activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r356519 - /incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java
Date Tue, 13 Dec 2005 16:18:29 GMT
Author: jstrachan
Date: Tue Dec 13 08:18:23 2005
New Revision: 356519

URL: http://svn.apache.org/viewcvs?rev=356519&view=rev
Log:
optimisation; if a JMS exception has already been thrown then don't wrap it again

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java?rev=356519&r1=356518&r2=356519&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/util/JMSExceptionSupport.java
Tue Dec 13 08:18:23 2005
@@ -38,6 +38,9 @@
     }
     
     public static JMSException create(Throwable cause) {
+        if (cause instanceof JMSException) {
+            return (JMSException) cause;
+        }
         String msg = cause.getMessage();
         if( msg==null || msg.length()==0 )
             msg = cause.toString();
@@ -47,6 +50,9 @@
     }
 
     public static JMSException create(Exception cause) {
+        if (cause instanceof JMSException) {
+            return (JMSException) cause;
+        }
         String msg = cause.getMessage();
         if( msg==null || msg.length()==0 )
             msg = cause.toString();



Mime
View raw message