focusing on using autoClose

This commit is contained in:
Rob Austin
2015-02-02 16:15:43 +00:00
parent 66dc092c7b
commit 24e6e5e515
4 changed files with 60 additions and 48 deletions
@@ -203,14 +203,17 @@ public class ChronicleMapTest {
final File persistenceFile = Builder.getPersistenceFile();
for (int i = 0; i < 2; i++) {
ChronicleMap<byte[], byte[]> map = ChronicleMapBuilder.of(byte[].class, byte[]
.class).createPersistedTo(persistenceFile);
try (ChronicleMap<byte[], byte[]> map = ChronicleMapBuilder.of(byte[].class, byte[]
.class).createPersistedTo(persistenceFile)) {
byte[] o = map.get("hello".getBytes());
System.out.println(o == null ? "null" : new String(o));
map.put("hello".getBytes(), "world".getBytes());
byte[] o = map.get("hello".getBytes());
System.out.println(o == null ? "null" : new String(o));
map.put("hello".getBytes(), "world".getBytes());
}
}
persistenceFile.delete();
}
@@ -1880,7 +1883,9 @@ public class ChronicleMapTest {
assertEquals(2, value1.getValue());
}
}
tmpFile.delete();
}
}