You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by kw...@apache.org on 2021/12/13 16:09:59 UTC

[jackrabbit-oak] branch trunk updated: OAK-9636 Close FileWriter when saving Manifest

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

kwin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6b9026e  OAK-9636 Close FileWriter when saving Manifest
6b9026e is described below

commit 6b9026ec698b7e762e2126a9d5d6875d0934a896
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Dec 13 17:09:52 2021 +0100

    OAK-9636 Close FileWriter when saving Manifest
---
 .../org/apache/jackrabbit/oak/segment/file/LocalManifestFile.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/LocalManifestFile.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/LocalManifestFile.java
index 4572265..94b420a 100644
--- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/LocalManifestFile.java
+++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/LocalManifestFile.java
@@ -54,7 +54,9 @@ public class LocalManifestFile implements ManifestFile {
 
     @Override
     public void save(Properties properties) throws IOException {
-        properties.store(new FileWriter(file), null);
+        try (FileWriter w = new FileWriter(file)) {
+            properties.store(w, null);
+        }
     }
 
 }