mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 11:06:25 +00:00
Close JarFile resources in PluginWrapper and UpdateCenter
This commit is contained in:
1 parent
bf7eb802d9
commit
b32b38cdc9
2 files changed
+13
-5
No files matched your search
@@ -567,7 +567,11 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
if (backup.exists()) {
|
||||
try {
|
||||
JarFile backupPlugin = new JarFile(backup);
|
||||
return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
|
||||
try {
|
||||
return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
|
||||
} finally {
|
||||
backupPlugin.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.log(WARNING, "Failed to get backup version ", e);
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user