Skip to content

Commit

Permalink
fixed a file descriptor leak
Browse files Browse the repository at this point in the history
  • Loading branch information
hneemann committed Oct 29, 2017
1 parent 23c096a commit 12ddec9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public Iterator<AdditionalShape> iterator() {
* @throws InvalidNodeException InvalidNodeException
*/
public void loadJar(File file) throws IOException, InvalidNodeException {
Manifest manifest = new JarFile(file).getManifest();
Manifest manifest;
try (JarFile jarFile = new JarFile(file)) {
manifest = jarFile.getManifest();
}
if (manifest == null)
throw new IOException(Lang.get("err_noManifestFound"));
Attributes attr = manifest.getMainAttributes();
Expand Down

0 comments on commit 12ddec9

Please sign in to comment.