From 6058071abded03b6b33615d619c50c527245795d Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sun, 6 Apr 2014 03:58:53 +0000 Subject: [PATCH] fix log message git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@856 f203690c-595d-4dc9-a70b-905162fa7fd2 --- .../jackcess/impl/IndexData.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java b/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java index 5174330..579deef 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java @@ -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); } } -- 2.39.5