commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r883483 - /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java
Date Mon, 23 Nov 2009 20:21:32 GMT
Author: sebb
Date: Mon Nov 23 20:21:28 2009
New Revision: 883483

URL: http://svn.apache.org/viewvc?rev=883483&view=rev
Log:
Only fetch the logwriter once

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java?rev=883483&r1=883482&r2=883483&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/SQLNestedException.java Mon
Nov 23 20:21:28 2009
@@ -67,9 +67,12 @@
     public SQLNestedException(String msg, Throwable cause) {
         super(msg);
         this.cause = cause;
-        if ((cause != null) && (DriverManager.getLogWriter() != null)) {
-            DriverManager.getLogWriter().print("Caused by: ");
-            cause.printStackTrace(DriverManager.getLogWriter());
+        if (cause != null){
+            final PrintWriter logWriter = DriverManager.getLogWriter();
+            if (logWriter != null) {
+                logWriter.print("Caused by: ");
+                cause.printStackTrace(logWriter);
+            }
         }
     }
     



Mime
View raw message