[JENKINS-36720]: Fixed some Spotbugs issues (#4180)

* [JENKINS-36720]: Fixed Spotbugs issues WMI_WRONG_MAP_ITERATOR and OS_OPEN_STREAM in core

* merged try with resources with try finally

* reverted auto format from IDE

* reverted auto format from IDE

* use Util.fileToPath() as suggested to remove catch block

* merged try statements

* merged try statements

* reverted some whitespace fixes

* reverted another whitespace fix

* Apply suggestions from code review

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* reverted change

* reverted change

* reverted change

Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
This commit is contained in:
StefanSpiekerandOleg Nenashev authored and Oleg Nenashev committed 2019-12-29 12:50:10 +01:00
1 parent 45d7cf1668
commit 8b893a1cbe
9 files changed
+44 -47

No files matched your search

+4 -1
View File
@@ -1669,7 +1669,10 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
JSONArray dependencies = new JSONArray();
try {
Manifest m = new JarFile(t).getManifest();
Manifest m;
try (JarFile jarFile = new JarFile(t)) {
m = jarFile.getManifest();
}
String deps = m.getMainAttributes().getValue("Plugin-Dependencies");
if (StringUtils.isNotBlank(deps)) {