summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-findbugs-plugin
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-05-16 14:58:55 +0200
committerFabrice Bellingard <bellingard@gmail.com>2012-05-16 15:00:33 +0200
commit737339e2a79230d7b5cbc7fce7147631a8ce5953 (patch)
tree7428f2cec9c996b3014b73d69e2978684487390e /plugins/sonar-findbugs-plugin
parent4d2eda6b07309dd871d1e2ad62e416b8d2240e18 (diff)
downloadsonarqube-737339e2a79230d7b5cbc7fce7147631a8ce5953.tar.gz
sonarqube-737339e2a79230d7b5cbc7fce7147631a8ce5953.zip
SONAR-3074 Keep SecurityManager in memory because FB plays with it
=> which causes an "access denied" on shutdown of the executor service
Diffstat (limited to 'plugins/sonar-findbugs-plugin')
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java2
1 files changed, 2 insertions, 0 deletions
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);