aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/healthmarketscience/jackcess
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2013-10-01 22:57:05 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2013-10-01 22:57:05 +0000
commit97eadc5acd14baf615376a47aca70ba739b88ab1 (patch)
tree139d2e526c155aead880f04210e983a58bc818a2 /src/main/java/com/healthmarketscience/jackcess
parenta79079c62392fca4e002716b166b8348361f8456 (diff)
downloadjackcess-97eadc5acd14baf615376a47aca70ba739b88ab1.tar.gz
jackcess-97eadc5acd14baf615376a47aca70ba739b88ab1.zip
minor updates and refactors
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@812 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess')
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java2
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java33
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/UsageMap.java9
3 files changed, 19 insertions, 25 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
index 7d26fd7..8f808cb 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
@@ -2170,7 +2170,7 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> {
if(TableImpl.rowFitsOnDataPage(dataLength, lvalPage, getFormat())) {
// the current page has space
return lvalPage;
-}
+ }
}
// need new page
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java
index 240ebf6..1d7e2e0 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java
@@ -1792,28 +1792,29 @@ public class TableImpl implements Table
TempPageHolder rowBufferH)
throws IOException
{
- // find last data page (Not bothering to check other pages for free
- // space.)
+ // find last data page (Not bothering to check other pages for free
+ // space.)
UsageMap.PageCursor revPageCursor = ownedPages.cursor();
- revPageCursor.afterLast();
- while(true) {
- int tmpPageNumber = revPageCursor.getPreviousPage();
- if(tmpPageNumber < 0) {
- break;
- }
+ revPageCursor.afterLast();
+ while(true) {
+ int tmpPageNumber = revPageCursor.getPreviousPage();
+ if(tmpPageNumber < 0) {
+ break;
+ }
+ // only use if actually listed in free space pages
+ if(!freeSpacePages.containsPageNumber(tmpPageNumber)) {
+ continue;
+ }
ByteBuffer dataPage = rowBufferH.setPage(ownedPages.getPageChannel(),
tmpPageNumber);
- if(dataPage.get() == PageTypes.DATA) {
- // found last data page, only use if actually listed in free space
- // pages
- if(freeSpacePages.containsPageNumber(tmpPageNumber)) {
- return dataPage;
- }
- }
+ if(dataPage.get() == PageTypes.DATA) {
+ // found last data page with free space
+ return dataPage;
}
+ }
return null;
- }
+ }
/**
* Updates the table definition after rows are modified.
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/UsageMap.java b/src/main/java/com/healthmarketscience/jackcess/impl/UsageMap.java
index ac49c44..5db2eac 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/UsageMap.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/UsageMap.java
@@ -330,13 +330,6 @@ public class UsageMap
/**
* Remove a page number from this usage map
*/
- public void removePageNumber(int pageNumber) throws IOException {
- removePageNumber(pageNumber, false);
- }
-
- /**
- * Remove a page number from this usage map
- */
protected void removePageNumber(int pageNumber, boolean force)
throws IOException
{
@@ -681,7 +674,7 @@ public class UsageMap
}
// lastly, remove the new page
- removePageNumber(newPageNumber);
+ removePageNumber(newPageNumber, false);
}
}