From: Fabrice Bellingard Date: Wed, 16 May 2012 12:58:55 +0000 (+0200) Subject: SONAR-3074 Keep SecurityManager in memory because FB plays with it X-Git-Tag: 3.1~186 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=737339e2a79230d7b5cbc7fce7147631a8ce5953;p=sonarqube.git SONAR-3074 Keep SecurityManager in memory because FB plays with it => which causes an "access denied" on shutdown of the executor service --- diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java index e1d6464c3ac..cf742540336 100644 --- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java +++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java @@ -68,6 +68,7 @@ public class FindbugsExecutor implements BatchExtension { public File execute() { TimeProfiler profiler = new TimeProfiler().start("Execute Findbugs " + FindbugsVersion.getVersion()); + SecurityManager currentSecurityManager = System.getSecurityManager(); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(FindBugs2.class.getClassLoader()); @@ -125,6 +126,7 @@ public class FindbugsExecutor implements BatchExtension { } catch (Exception e) { throw new SonarException("Can not execute Findbugs", e); } finally { + System.setSecurityManager(currentSecurityManager); resetCustomPluginList(customPlugins); executorService.shutdown(); IOUtils.closeQuietly(xmlOutput);