You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/10/19 04:28:11 UTC

[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #6995: [HUDI-3900] Closing resources in TestHoodieLogRecord

alexeykudinkin commented on code in PR #6995:
URL: https://github.com/apache/hudi/pull/6995#discussion_r998929769


##########
hudi-common/src/test/java/org/apache/hudi/common/functional/TestHoodieLogFormat.java:
##########
@@ -155,6 +155,7 @@ public void testEmptyLog() throws IOException {
     assertEquals(0, writer.getCurrentSize(), "Just created this log, size should be 0");
     assertTrue(writer.getLogFile().getFileName().startsWith("."), "Check all log files should start with a .");
     assertEquals(1, writer.getLogFile().getLogVersion(), "Version should be 1 for new log created");
+    writer.close();

Review Comment:
   @nsivabalan for the future reference: it's easier to manage and more predictable to use try-with-resources statement:
   
   ```
   try (Closeable c = ...) {
     // Will be closed automatically even in the presence of exceptions
   }
   ```



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org