7040150: Indexing Error in CachedRowSetImpl.removeCurrentRow
authorlancea
Fri, 29 Apr 2011 09:04:03 -0400
changeset 9537 bfddc73b74b9
parent 9536 648c9add2a74
child 9538 e6df26dc76c5
7040150: Indexing Error in CachedRowSetImpl.removeCurrentRow Reviewed-by: smarks
jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
--- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Thu Apr 28 20:48:36 2011 -0700
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Fri Apr 29 09:04:03 2011 -0400
@@ -1666,7 +1666,7 @@
      */
     protected void removeCurrentRow() {
         ((Row)getCurrentRow()).setDeleted();
-        rvh.remove(cursorPos);
+        rvh.remove(cursorPos - 1);
         --numRows;
     }
 
@@ -6349,7 +6349,6 @@
         // this can happen if deleted rows are being shown
         if (row.getDeleted() == true) {
             removeCurrentRow();
-            --numRows;
         }
     }