openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r666920 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
Date Wed, 11 Jun 2008 23:59:44 GMT
Author: pcl
Date: Wed Jun 11 16:59:44 2008
New Revision: 666920

URL: http://svn.apache.org/viewvc?rev=666920&view=rev
Log:
 Merge from ../branches/1.1.x. svn merge -c 657148 ../branches/1.1.x

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java?rev=666920&r1=666919&r2=666920&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java Wed
Jun 11 16:59:44 2008
@@ -171,7 +171,9 @@
         if (i < nested.length) {
             out.println("NestedThrowables:");
             for (; i < nested.length; i++)
-                nested[i].printStackTrace(out);
+                // guard against a nasty null in the array
+                if (nested[i] != null)
+                    nested[i].printStackTrace(out);
         }
     }
 
@@ -188,7 +190,9 @@
         if (i < nested.length) {
             out.println("NestedThrowables:");
             for (; i < nested.length; i++)
-                nested[i].printStackTrace(out);
+                // guard against a nasty null in the array
+                if (nested[i] != null)
+                    nested[i].printStackTrace(out);
         }
     }
 
@@ -239,7 +243,10 @@
             if (isSerializable(nested[i]))
                 newNested[i] = nested[i];
             else
-                newNested[i] = new Exception(nested[i].toString());
+                // guard against a nasty null in the array by using valueOf
+                // instead of toString to prevent throwing yet another 
+                // exception
+                newNested[i] = new Exception(String.valueOf(nested[i]));
         }
         return newNested;
     }



Mime
View raw message