db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1068772 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
Date Wed, 09 Feb 2011 07:36:02 GMT
Author: kahatlen
Date: Wed Feb  9 07:36:02 2011
New Revision: 1068772

URL: http://svn.apache.org/viewvc?rev=1068772&view=rev
Log:
DERBY-5012: bad allocation guard in ResultSet#resetUpdatedColumnsForInsert

Reworked fix based on patch contributed by Dave Brosius <dbrosius@apache.org>.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java?rev=1068772&r1=1068771&r2=1068772&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java Wed Feb  9 07:36:02
2011
@@ -4694,16 +4694,8 @@ public abstract class ResultSet implemen
 
     private final void resetUpdatedColumnsForInsert() {
         // initialize updateColumns with nulls for all columns
-        if (updatedColumns_ == null) {
-            updatedColumns_ = new Object[resultSetMetaData_.columns_];
-        }
-        if (columnUpdated_ != null) {
-            columnUpdated_ = new boolean[resultSetMetaData_.columns_];
-        }
-        for (int i = 0; i < updatedColumns_.length; i++) {
+        for (int i = 0; i < resultSetMetaData_.columns_; i++) {
             updateColumn(i+1, null);
-        }
-        for (int i = 0; i < columnUpdated_.length; i++) {
             columnUpdated_[i] = false;
         }
     }



Mime
View raw message