fix: resource leak in template fast-debug code
authorFelix Dörre <felix@dogcraft.de>
Fri, 7 Oct 2016 22:19:04 +0000 (00:19 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 16 Oct 2016 13:29:03 +0000 (15:29 +0200)
Change-Id: I570f997bb3e61d916ccc2dfd0ad23c8225ee9020

src/org/cacert/gigi/output/template/Template.java

index 21c2b04e578b51e1553640d678d7f86c24b61a0f..6aa9348a7f1ed942a782b3af59144fc0240e2e29 100644 (file)
@@ -236,9 +236,8 @@ public class Template implements Outputable {
 
     protected void tryReload() {
         if (source != null && lastLoaded < source.lastModified()) {
-            try {
-                System.out.println("Reloading template.... " + source);
-                InputStreamReader r = new InputStreamReader(new FileInputStream(source), "UTF-8");
+            System.out.println("Reloading template.... " + source);
+            try (InputStreamReader r = new InputStreamReader(new FileInputStream(source), "UTF-8")) {
                 data = parse(r).getBlock(null);
                 r.close();
                 lastLoaded = source.lastModified() + 1000;