rely on try-with-resources

This commit is contained in:
Nicolas De Loof authored and Nicolas De loof committed 2016-10-03 15:12:48 +02:00
1 parent 2acecf5d7a
commit 7b39424495
40 files changed
+196 -400

No files matched your search

+1 -4
View File
@@ -708,11 +708,8 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
File backup = getBackupFile();
if (backup.exists()) {
try {
JarFile backupPlugin = new JarFile(backup);
try {
try (JarFile backupPlugin = new JarFile(backup)) {
return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
} finally {
backupPlugin.close();
}
} catch (IOException e) {
LOGGER.log(WARNING, "Failed to get backup version from " + backup, e);