This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 117f4d4060 fix: Fix `FileOutputStream` not close automatically (#6135)
117f4d4060 is described below

commit 117f4d406044a9d33b3d99d9e4b6b7173140e8d0
Author: wallezhang <[email protected]>
AuthorDate: Thu Jun 2 08:59:26 2022 +0800

    fix: Fix `FileOutputStream` not close automatically (#6135)
---
 .../main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
 
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
index 69dfc67233..bb8d20966b 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
@@ -267,7 +267,9 @@ public class NodeInfo implements SnapshotProcessor {
     }
     systemProperties.setProperty(
         "confignode_list", NodeUrlUtils.convertTConfigNodeUrls(new 
ArrayList<>(onlineConfigNodes)));
-    systemProperties.store(new FileOutputStream(systemPropertiesFile), "");
+    try (FileOutputStream fileOutputStream = new 
FileOutputStream(systemPropertiesFile)) {
+      systemProperties.store(fileOutputStream, "");
+    }
   }
 
   public List<TConfigNodeLocation> getOnlineConfigNodes() {

Reply via email to