Skip to content

Commit

Permalink
fix: stop updating the security manager (#717)
Browse files Browse the repository at this point in the history
Since SpotBugs 4.7.3 and spotbugs/spotbugs#2123
it is no longer necessary to set the security manager6
  • Loading branch information
gtoison committed Feb 12, 2023
1 parent a8ed444 commit e63d6eb
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ public Collection<ReportedBug> execute(boolean useAllPlugin) {
}

public Collection<ReportedBug> execute(boolean useFbContrib, boolean useFindSecBugs) {
// We keep a handle on the current security manager because FB plays with it and we need to restore it before shutting down the executor
// service
SecurityManager currentSecurityManager = System.getSecurityManager();
ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(FindBugs2.class.getClassLoader());

Expand Down Expand Up @@ -187,8 +184,6 @@ public Collection<ReportedBug> execute(boolean useFbContrib, boolean useFindSecB
} catch (Exception e) {
throw new IllegalStateException("Can not execute Findbugs", e);
} finally {
// we set back the original security manager BEFORE shutting down the executor service, otherwise there's a problem with Java 5
System.setSecurityManager(currentSecurityManager);
resetCustomPluginList(customPlugins);
executorService.shutdown();
IOUtils.closeQuietly(xmlOutput);
Expand Down

0 comments on commit e63d6eb

Please sign in to comment.