fix: Close resources we no longer need
authorBenny Baumann <BenBE1987@gmx.net>
Sun, 19 Mar 2017 17:31:45 +0000 (18:31 +0100)
committerBenny Baumann <BenBE1987@gmx.net>
Wed, 22 Mar 2017 18:22:07 +0000 (19:22 +0100)
Change-Id: Ife98cacc393010c60689525a358cab5823cb8cf7

src/club/wpia/gigi/util/DomainAssessment.java

index d24404ed4676752aa9aab075c2186c43a2c9f400..e17f2eea2ae724173c5f4f6846996690077a47eb 100644 (file)
@@ -148,11 +148,14 @@ public class DomainAssessment {
 
     public static void init(Properties conf) {
         String financialName = conf.getProperty("highFinancialValue");
+
         if (financialName == null) {
             throw new Error("No property highFinancialValue was configured");
         }
-        try {
-            financial = new DomainSet(new InputStreamReader(new FileInputStream(new File(financialName)), "UTF-8"));
+
+        try (FileInputStream fis = new FileInputStream(new File(financialName)); //
+                InputStreamReader isr = new InputStreamReader(fis, "UTF-8")) {
+            financial = new DomainSet(isr);
         } catch (IOException e) {
             throw new Error(e);
         }