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>
}
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();
} 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