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


##########
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/AllocateDirectMapMemoryTest.java:
##########
@@ -25,47 +25,44 @@
 
 import static org.apache.datasketches.memory.internal.Util.getResourceFile;
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import java.io.File;
 import java.nio.ByteOrder;
 
-import org.apache.datasketches.memory.MapHandle;
 import org.apache.datasketches.memory.Memory;
-import org.testng.annotations.AfterClass;
+import org.apache.datasketches.memory.MemoryCloseException;
+import org.apache.datasketches.memory.MemoryInvalidException;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class AllocateDirectMapMemoryTest {
   private static final String LS = System.getProperty("line.separator");
-  MapHandle hand = null;
 
   @BeforeClass
   public void setReadOnly() {
     UtilTest.setGettysburgAddressFileToReadOnly();
   }
 
   @Test
-  public void simpleMap() throws Exception {
+  public void simpleMap() {
     File file = getResourceFile("GettysburgAddress.txt");
-    assertTrue(AllocateDirectMap.isFileReadOnly(file));
-    try (MapHandle rh = Memory.map(file)) {
-      rh.close();
-    }
+    assertTrue(AllocateDirectWritableMap.isFileReadOnly(file));
+    try (Memory mem = Memory.map(file)) {
+      mem.close(); //redundant close

Review Comment:
   I would prefer the comment to explain why



-- 
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