Fix CID 1350574 & 1350993 & 1350651 64/18864/2
Clément DAVID [Wed, 11 Jan 2017 08:04:44 +0000 (09:04 +0100)]
Change-Id: I2c73a21536c157e30938c7719426cd76c1b3b0d7

scilab/modules/external_objects_java/src/java/org/scilab/modules/external_objects_java/ScilabJarCreator.java

index d811b23..1ff9ac5 100644 (file)
@@ -72,7 +72,9 @@ public class ScilabJarCreator {
                 manifestFilePath = commonPath + File.separator + "META-INF" + File.separator + "MANIFEST.MF";
             }
             if (new File(manifestFilePath).exists()) {
-                manifest = new Manifest(new FileInputStream(manifestFilePath));
+                FileInputStream fis = new FileInputStream(manifestFilePath);
+                manifest = new Manifest(fis);
+                fis.close();
             } else {
                 manifest = new Manifest();
             }
@@ -105,7 +107,7 @@ public class ScilabJarCreator {
             closeJarArchive(jarOutputStream);
             jarOutputStream = null;
             return 0;
-        } catch (Exception e) {
+        } catch (IOException e) {
             try {
                 closeJarArchive(jarOutputStream);
                 deleteJarArchive(jarFilePath);