Skip to content

Commit 57b1b5b

Browse files
committed
ByteArrayProxy should be used via its static final field
1 parent 530296e commit 57b1b5b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/org/lmdbjava/ByteArrayProxy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public final class ByteArrayProxy extends BufferProxy<byte[]> {
4040

4141
private static final MemoryManager MEM_MGR = RUNTIME.getMemoryManager();
4242

43+
private ByteArrayProxy() {
44+
}
45+
4346
/**
4447
* Lexicographically compare two byte arrays.
4548
*

src/test/java/org/lmdbjava/DbiTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import org.junit.Rule;
6161
import org.junit.Test;
6262
import org.junit.rules.TemporaryFolder;
63+
import static org.lmdbjava.ByteArrayProxy.PROXY_BA;
6364
import static org.lmdbjava.ByteBufferProxy.PROXY_OPTIMAL;
6465
import org.lmdbjava.CursorIterable.KeyVal;
6566
import org.lmdbjava.Dbi.DbFullException;
@@ -327,7 +328,7 @@ public void putCommitGet() {
327328
@Test
328329
public void putCommitGetByteArray() throws IOException {
329330
final File path = tmp.newFile();
330-
try (Env<byte[]> envBa = create(new ByteArrayProxy())
331+
try (Env<byte[]> envBa = create(PROXY_BA)
331332
.setMapSize(MEBIBYTES.toBytes(64))
332333
.setMaxReaders(1)
333334
.setMaxDbs(2)

0 commit comments

Comments
 (0)