Skip to content

Commit 0106515

Browse files
committed
refactor: make explicit the use of the FileLock in ChannelLock
Signed-off-by: Caleb Hulbert <cmhulbert@gmail.com>
1 parent c3fc414 commit 0106515

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/java/org/janelia/saalfeldlab/n5/ChannelLock.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
class ChannelLock implements Closeable {
1717

1818
private final FileChannel channel;
19-
private final FileLock lock;
19+
20+
//Used to ensure a hard reference exists until we close
21+
@SuppressWarnings({"unused", "FieldCanBeLocal"})
22+
private final FileLock unusedHardRef;
2023

2124
private ChannelLock(final FileChannel channel, final FileLock lock) {
2225
this.channel = channel;
23-
this.lock = lock;
26+
this.unusedHardRef = lock;
2427
}
2528

2629
public void close() throws IOException {

0 commit comments

Comments
 (0)