]> source.dussan.org Git - jackcess.git/commitdiff
fix log message
authorJames Ahlborn <jtahlborn@yahoo.com>
Sun, 6 Apr 2014 03:58:53 +0000 (03:58 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sun, 6 Apr 2014 03:58:53 +0000 (03:58 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@856 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java

index 51743309186b89c41fbc4f74fc80d78724eca8f9..579deef5a6e0fd5296e26006402a498c7bed21fc 100644 (file)
@@ -595,6 +595,10 @@ public class IndexData {
       }
 
       change.setAddRow(newEntry, dataPage, idx, isDupeEntry);
+
+    } else {
+
+      change.setOldRow(newEntry);
     }
     return change;
   }
@@ -603,7 +607,7 @@ public class IndexData {
    * Completes a prepared row addition.
    */
   private void commitAddRow(Entry newEntry, DataPage dataPage, int idx,
-                            boolean isDupeEntry)
+                            boolean isDupeEntry, Entry oldEntry)
     throws IOException
   {
     if(newEntry != null) {
@@ -613,7 +617,7 @@ public class IndexData {
       }
       ++_modCount;
     } else {
-      LOG.warn("Added duplicate index entry " + newEntry);
+      LOG.warn("Added duplicate index entry " + oldEntry);
     }
   }
 
@@ -635,7 +639,7 @@ public class IndexData {
     throws IOException
   {
     UpdateRowPendingChange change = new UpdateRowPendingChange(nextChange);
-    change.setDeletedRow(deleteRowImpl(oldRow, rowId));
+    change.setOldRow(deleteRowImpl(oldRow, rowId));
 
     try {
       prepareAddRow(newRow, rowId, change);
@@ -2581,10 +2585,11 @@ public class IndexData {
    */
   private class AddRowPendingChange extends PendingChange
   {
-    private Entry _addEntry;
-    private DataPage _addDataPage;
-    private int _addIdx;
-    private boolean _isDupe;
+    protected Entry _addEntry;
+    protected DataPage _addDataPage;
+    protected int _addIdx;
+    protected boolean _isDupe;
+    protected Entry _oldEntry;
 
     private AddRowPendingChange(PendingChange next) {
       super(next);
@@ -2598,9 +2603,13 @@ public class IndexData {
       _isDupe = isDupe;
     }
 
+    public void setOldRow(Entry oldEntry) {
+      _oldEntry = oldEntry;
+    }
+
     @Override
     public void commit() throws IOException {
-      commitAddRow(_addEntry, _addDataPage, _addIdx, _isDupe);
+      commitAddRow(_addEntry, _addDataPage, _addIdx, _isDupe, _oldEntry);
     }
     
     @Override
@@ -2617,20 +2626,14 @@ public class IndexData {
    */
   private class UpdateRowPendingChange extends AddRowPendingChange
   {
-    private Entry _removedEntry;
-
     private UpdateRowPendingChange(PendingChange next) {
       super(next);
     }
 
-    public void setDeletedRow(Entry removedEntry) {
-      _removedEntry = removedEntry;
-    }
-
     @Override
     public void rollback() throws IOException {
       super.rollback();
-      rollbackDeletedRow(_removedEntry);
+      rollbackDeletedRow(_oldEntry);
     }
   }