Skip to content

Commit a98fcf1

Browse files
Deprecated APIs: remove BoxStore.sizeOnDisk
This was deprecated in release 4.0.0
1 parent 5089e37 commit a98fcf1

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ For more insights into what changed in the ObjectBox C++ core, [check the Object
1313
- To help diagnose, print stacks of all threads in the internal thread pool if shutting it down takes too long when
1414
closing `BoxStore`.
1515
- Remove deprecated `Box.removeByKeys`, use `Box.removeByIds` instead.
16+
- Remove deprecated `BoxStore.sizeOnDisk`, use `getDbSize` or `getDbSizeOnDisk` instead which properly handle in-memory databases.
1617
- Remove deprecated `SyncServerBuilder` `peer` configuration options, use the `clusterPeer` options instead.
1718
- Remove deprecated `io.objectbox.DebugFlags`, use `io.objectbox.config.DebugFlags` instead.
1819
- Remove deprecated `ValidateOnOpenMode` constants, use `ValidateOnOpenModePages` instead.

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -513,17 +513,6 @@ public static long sysProcStatusKb(String key) {
513513
return nativeSysProcStatusKb(key);
514514
}
515515

516-
/**
517-
* The size in bytes occupied by the data file on disk.
518-
*
519-
* @return 0 if the size could not be determined (does not throw unless this store was already closed)
520-
* @deprecated Use {@link #getDbSize()} or {@link #getDbSizeOnDisk()} instead which properly handle in-memory databases.
521-
*/
522-
@Deprecated
523-
public long sizeOnDisk() {
524-
return getDbSize();
525-
}
526-
527516
/**
528517
* Get the size of this store. For a disk-based store type, this corresponds to the size on disk, and for the
529518
* in-memory store type, this is roughly the used memory bytes occupied by the data.

tests/objectbox-java-test/src/test/java/io/objectbox/BoxStoreTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public void testClose() {
113113
store.setSyncClient(null);
114114

115115
// Methods using the native store should throw.
116-
assertThrowsStoreIsClosed(store::sizeOnDisk);
117116
assertThrowsStoreIsClosed(store::getDbSize);
118117
assertThrowsStoreIsClosed(store::getDbSizeOnDisk);
119118
assertThrowsStoreIsClosed(store::beginTx);
@@ -322,10 +321,6 @@ private Callable<String> createTestCallable(final int[] countHolder) {
322321
@Test
323322
public void testSizeOnDisk() {
324323
// Note: initial database does have a non-zero (file) size.
325-
@SuppressWarnings("deprecation")
326-
long legacySizeOnDisk = store.sizeOnDisk();
327-
assertTrue(legacySizeOnDisk > 0);
328-
329324
assertTrue(store.getDbSize() > 0);
330325

331326
long sizeOnDisk = store.getDbSizeOnDisk();

0 commit comments

Comments
 (0)