Skip to content

Commit dd8e606

Browse files
committed
FileHandleTest: use try-with-resources block
1 parent 6121cf8 commit dd8e606

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/test/java/org/scijava/io/handle/FileHandleTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ public void testNotCreatedByClose() throws IOException {
103103
assertFalse(nonExistentFile.exists());
104104

105105
final FileLocation loc = new FileLocation(nonExistentFile);
106-
final DataHandle<?> handle = dhs.create(loc);
107-
assertTrue(handle instanceof FileHandle);
108-
assertFalse(handle.exists());
109-
110-
handle.close();
106+
try (final DataHandle<?> handle = dhs.create(loc)) {
107+
assertTrue(handle instanceof FileHandle);
108+
assertFalse(handle.exists());
109+
}
111110
assertFalse(nonExistentFile.exists());
112111
}
113112

0 commit comments

Comments
 (0)