You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ni...@apache.org on 2009/11/28 12:09:45 UTC
svn commit: r885084 -
/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
Author: niallp
Date: Sat Nov 28 11:09:45 2009
New Revision: 885084
URL: http://svn.apache.org/viewvc?rev=885084&view=rev
Log:
Use initCause() method with SQLException rather than commeting out for pre-JDK-1.6
Modified:
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java?rev=885084&r1=885083&r2=885084&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java Sat Nov 28 11:09:45 2009
@@ -147,11 +147,7 @@
String message = "Cannot load XA data source class '" + xaDataSource + "'";
logWriter.println(message);
t.printStackTrace(logWriter);
- throw new SQLException(message
- /* JDBC_4_ANT_KEY_BEGIN */
- , t
- /* JDBC_4_ANT_KEY_END */
- );
+ throw (SQLException)new SQLException(message).initCause(t);
}
try {
@@ -160,11 +156,7 @@
String message = "Cannot create XA data source of class '" + xaDataSource + "'";
logWriter.println(message);
t.printStackTrace(logWriter);
- throw new SQLException(message
- /* JDBC_4_ANT_KEY_BEGIN */
- , t
- /* JDBC_4_ANT_KEY_END */
- );
+ throw (SQLException)new SQLException(message).initCause(t);
}
}
@@ -209,11 +201,7 @@
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
- throw new SQLException("Cannot create PoolableConnectionFactory (" + e.getMessage() + ")"
- /* JDBC_4_ANT_KEY_BEGIN */
- , e
- /* JDBC_4_ANT_KEY_END */
- );
+ throw (SQLException)new SQLException("Cannot create PoolableConnectionFactory (" + e.getMessage() + ")").initCause(e);
}
}
}