diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2014-04-06 03:58:53 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2014-04-06 03:58:53 +0000 |
commit | 6058071abded03b6b33615d619c50c527245795d (patch) | |
tree | c48ad06ea7dea420e8b380f521c53d4d690f82d0 /src/main | |
parent | 24ea8852310be2ad6a520566894b06a91664d4c1 (diff) | |
download | jackcess-6058071abded03b6b33615d619c50c527245795d.tar.gz jackcess-6058071abded03b6b33615d619c50c527245795d.zip |
fix log message
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@856 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java | 33 |
1 files 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); } } |