AlexanderSaydakov commented on code in PR #250:
URL: 
https://github.com/apache/datasketches-memory/pull/250#discussion_r1932713331


##########
src/test/java/org/apache/datasketches/memory/internal/AllocateDirectMapMemoryTest.java:
##########
@@ -43,48 +43,52 @@ public class AllocateDirectMapMemoryTest {
   @Test
   public void simpleMap() throws IOException {
     File file = UtilTest.setGettysburgAddressFileToReadOnly();
+    Memory mem = null;
     try (Arena arena = Arena.ofConfined()) {
-      Memory mem = Memory.map(file, arena);
+      mem = Memory.map(file, arena);
       arena.close();
     } //The Try-With-Resources will throw since it is already closed
     catch (IllegalStateException e) { /* OK */ }
+    assertFalse(mem.isAlive());

Review Comment:
   mem can be null if something throws before the assignment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to