tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1088665 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java
Date Mon, 04 Apr 2011 15:46:11 GMT
Author: fhanik
Date: Mon Apr  4 15:46:10 2011
New Revision: 1088665

URL: http://svn.apache.org/viewvc?rev=1088665&view=rev
Log:
incorporate feedback based on 
http://markmail.org/message/gz7lm5dpdpdgcdzq


Modified:
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java?rev=1088665&r1=1088664&r2=1088665&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java
Mon Apr  4 15:46:10 2011
@@ -39,11 +39,10 @@ public class TrapException extends JdbcI
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         try {
             return super.invoke(proxy, method, args);
-        }catch (Throwable t) {
+        }catch (Exception t) {
             Throwable exception = t;
             if (t instanceof InvocationTargetException) {
-                InvocationTargetException it = (InvocationTargetException)t;
-                exception = it.getCause()!=null?it.getCause():it;
+                exception = t.getCause()!=null?t.getCause():t;
             } 
             Class<?> exceptionClass = exception.getClass();
             if (!isDeclaredException(method, exceptionClass)) {
@@ -64,7 +63,7 @@ public class TrapException extends JdbcI
     
     public boolean isDeclaredException(Method m, Class<?> clazz) {
         for (Class<?> cl : m.getExceptionTypes()) {
-            if (cl.equals(clazz)) return true;
+            if (cl.equals(clazz) || cl.isAssignableFrom(clazz)) return true;
         }
         return false;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message