tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1201251 - in /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool: ProxyConnection.java TrapException.java interceptor/AbstractQueryReport.java interceptor/StatementDecoratorInterceptor.java
Date Sat, 12 Nov 2011 12:01:48 GMT
Author: kkolinko
Date: Sat Nov 12 12:01:48 2011
New Revision: 1201251

URL: http://svn.apache.org/viewvc?rev=1201251&view=rev
Log:
Simplify code: remove unneeded classcast.

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

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java?rev=1201251&r1=1201250&r2=1201251&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
Sat Nov 12 12:01:48 2011
@@ -108,8 +108,7 @@ public class ProxyConnection extends Jdb
                 return method.invoke(connection.getXAConnection(),args);
             }catch (Throwable t) {
                 if (t instanceof InvocationTargetException) {
-                    InvocationTargetException it = (InvocationTargetException)t;
-                    throw it.getCause()!=null?it.getCause():it;
+                    throw t.getCause() != null ? t.getCause() : t;
                 } else {
                     throw t;
                 }
@@ -130,8 +129,7 @@ public class ProxyConnection extends Jdb
             }
         }catch (Throwable t) {
             if (t instanceof InvocationTargetException) {
-                InvocationTargetException it = (InvocationTargetException)t;
-                throw it.getCause()!=null?it.getCause():it;
+                throw t.getCause() != null ? t.getCause() : t;
             } else {
                 throw t;
             }

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=1201251&r1=1201250&r2=1201251&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
Sat Nov 12 12:01:48 2011
@@ -42,7 +42,7 @@ public class TrapException extends JdbcI
         }catch (Exception t) {
             Throwable exception = t;
             if (t instanceof InvocationTargetException) {
-                exception = t.getCause()!=null?t.getCause():t;
+                exception = t.getCause() != null ? t.getCause() : t;
             }
             Class<?> exceptionClass = exception.getClass();
             if (!isDeclaredException(method, exceptionClass)) {

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java?rev=1201251&r1=1201250&r2=1201251&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
Sat Nov 12 12:01:48 2011
@@ -236,8 +236,7 @@ public abstract class AbstractQueryRepor
             }catch (Throwable t) {
                 reportFailedQuery(query,args,name,start,t);
                 if (t instanceof InvocationTargetException) {
-                    InvocationTargetException it = (InvocationTargetException)t;
-                    throw it.getCause()!=null?it.getCause():it;
+                    throw t.getCause() != null ? t.getCause() : t;
                 } else {
                     throw t;
                 }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java?rev=1201251&r1=1201250&r2=1201251&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
Sat Nov 12 12:01:48 2011
@@ -232,8 +232,7 @@ public class StatementDecoratorIntercept
                 }
             } catch (Throwable t) {
                 if (t instanceof InvocationTargetException) {
-                    InvocationTargetException it = (InvocationTargetException) t;
-                    throw it.getCause() != null ? it.getCause() : it;
+                    throw t.getCause() != null ? t.getCause() : t;
                 } else {
                     throw t;
                 }



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


Mime
View raw message