7049107: Cannot call initCause() on BatchUpdateException
authorlancea
Thu, 02 Jun 2011 12:02:14 -0400
changeset 9777 3f97b6a96ac5
parent 9776 3b9d58a79b55
child 9778 967402e4be8b
child 9790 b38864b89ce3
7049107: Cannot call initCause() on BatchUpdateException Reviewed-by: darcy
jdk/src/share/classes/java/sql/BatchUpdateException.java
--- a/jdk/src/share/classes/java/sql/BatchUpdateException.java	Tue May 31 12:45:17 2011 -0700
+++ b/jdk/src/share/classes/java/sql/BatchUpdateException.java	Thu Jun 02 12:02:14 2011 -0400
@@ -79,7 +79,8 @@
    */
   public BatchUpdateException( String reason, String SQLState, int vendorCode,
                                int[] updateCounts ) {
-      this(reason, SQLState, vendorCode, updateCounts, null);
+      super(reason, SQLState, vendorCode);
+      this.updateCounts  = (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length);
   }
 
   /**
@@ -106,7 +107,7 @@
    */
   public BatchUpdateException(String reason, String SQLState,
                               int[] updateCounts) {
-      this(reason, SQLState, 0, updateCounts, null);
+      this(reason, SQLState, 0, updateCounts);
   }
 
   /**
@@ -132,7 +133,7 @@
    * @since 1.2
    */
   public  BatchUpdateException(String reason, int[] updateCounts) {
-      this(reason, null, 0, updateCounts, null);
+      this(reason, null, 0, updateCounts);
   }
 
   /**
@@ -155,7 +156,7 @@
    * @since 1.2
    */
   public BatchUpdateException(int[] updateCounts) {
-      this(null, null, 0, updateCounts, null);
+      this(null, null, 0, updateCounts);
   }
 
   /**
@@ -170,7 +171,7 @@
    * @since 1.2
    */
   public BatchUpdateException() {
-        this(null, null, 0, null, null);
+        this(null, null, 0, null);
   }
 
     /**