Skip to content

Commit 444366f

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

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
@@ -15,11 +15,14 @@
1515
class ChannelLock implements Closeable {
1616

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

2023
private ChannelLock(final FileChannel channel, final FileLock lock) {
2124
this.channel = channel;
22-
this.lock = lock;
25+
this.unusedHardRef = lock;
2326
}
2427

2528
public void close() throws IOException {

0 commit comments

Comments
 (0)