From acd4d7499c8ffd7f0a455720b084463f126111ba Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Thu, 1 Nov 2018 14:42:43 +0900 Subject: Fix sonar blocker issue in epsdk-analytics Fix Remove this throw statement from this finally block sonar issue. Issue-ID: PORTAL-342 Change-Id: Ibe3b4f0cf86dede3cec1355e2a4b455fe4d44651 Signed-off-by: Parshad Patel --- .../onap/portalsdk/analytics/system/fusion/AntBuild.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics/src/main/java') diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/AntBuild.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/AntBuild.java index aa01b184..b416f779 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/AntBuild.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/AntBuild.java @@ -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 -- cgit 1.2.3-korg