Fix some warnings
[fanfix.git] / src / be / nikiroo / fanfix / test / Test.java
index 3ff9a7ab8d139ad3e42c46f9caed8d504021f5e7..c5d852d397c5c746a6f2cd34b161b030aaa0496f 100644 (file)
@@ -47,12 +47,17 @@ public class Test extends TestLauncher {
                tmpCache.delete();
                tmpCache.mkdir();
 
                tmpCache.delete();
                tmpCache.mkdir();
 
-               FileOutputStream out = new FileOutputStream(new File(tmpConfig,
-                               "config.properties"));
-               Properties props = new Properties();
-               props.setProperty("CACHE_DIR", tmpCache.getAbsolutePath());
-               props.store(out, null);
-               out.close();
+               FileOutputStream out = null;
+               try {
+                       out = new FileOutputStream(new File(tmpConfig, "config.properties"));
+                       Properties props = new Properties();
+                       props.setProperty("CACHE_DIR", tmpCache.getAbsolutePath());
+                       props.store(out, null);
+               } finally {
+                       if (out != null) {
+                               out.close();
+                       }
+               }
 
                ConfigBundle config = new ConfigBundle();
                Bundles.setDirectory(tmpConfig.getAbsolutePath());
 
                ConfigBundle config = new ConfigBundle();
                Bundles.setDirectory(tmpConfig.getAbsolutePath());