Java 7: try with resources

This commit is contained in:
Josh Soref committed 2019-02-20 22:01:10 -05:00
1 parent 345b964962
commit b79ec4ff48
3 files changed
+5 -17

No files matched your search

+2 -5
View File
@@ -1770,12 +1770,9 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
protected String identifyPluginShortName(File t) {
try {
JarFile j = new JarFile(t);
try {
try (JarFile j = new JarFile(t)) {
String name = j.getManifest().getMainAttributes().getValue("Short-Name");
if (name!=null) return name;
} finally {
j.close();
if (name != null) return name;
}
} catch (IOException e) {
LOGGER.log(WARNING, "Failed to identify the short name from "+t,e);