mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 04:25:23 +00:00
rely on try-with-resources
This commit is contained in:
1 parent
2acecf5d7a
commit
7b39424495
40 files changed
+196
-400
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user