Fix sonar blocker issue in epsdk-analytics 12/71612/1
authorParshad Patel <pars.patel@samsung.com>
Thu, 1 Nov 2018 05:42:43 +0000 (14:42 +0900)
committerParshad Patel <pars.patel@samsung.com>
Thu, 1 Nov 2018 05:50:28 +0000 (14:50 +0900)
Fix Remove this throw statement from this finally block sonar issue.

Issue-ID: PORTAL-342
Change-Id: Ibe3b4f0cf86dede3cec1355e2a4b455fe4d44651
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/AntBuild.java

index aa01b18..b416f77 100644 (file)
@@ -57,9 +57,8 @@ public class AntBuild {
        }
 
        public static void readManifest() {
-               JarFile jar = null;
-               try {
-                       jar = new JarFile("./raptor_fusion.jar");
+               try(JarFile jar = new JarFile("./raptor_fusion.jar")){
+
                        Manifest manifest = jar.getManifest();
 
                        Attributes attribs = manifest.getMainAttributes();
@@ -81,14 +80,6 @@ public class AntBuild {
                } catch (IOException e) {
                        System.err.println("Cannot read jar-file manifest: "
                                        + e.getMessage());
-               } finally {
-                       if (jar != null) {
-                               try {
-                                       jar.close();
-                               } catch (IOException e) {
-                       throw new RuntimeException("Failed to close jar '");
-                               }
-                       }
                }
        }
 }
\ No newline at end of file