From 22765ee40acdf014cd59e448c0a3c17b64773a8d Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Sun, 20 May 2012 15:41:22 +0200 Subject: [PATCH] SONAR-3074 Improve the logging when duplicate FB plugin is loaded --- .../org/sonar/plugins/findbugs/FindbugsExecutor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 2d3aeaf389d..a6db51eabb8 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 @@ -58,6 +58,8 @@ import java.util.concurrent.TimeUnit; */ public class FindbugsExecutor implements BatchExtension { + private static final String FINDBUGS_CORE_PLUGIN_ID = "edu.umd.cs.findbugs.plugins.core"; + private static final Logger LOG = LoggerFactory.getLogger(FindbugsExecutor.class); private FindbugsConfiguration configuration; @@ -182,8 +184,11 @@ public class FindbugsExecutor implements BatchExtension { } catch (PluginException e) { LOG.warn("Failed to load plugin for custom detector: " + path); } catch (DuplicatePluginIdException e) { - // simply ignore this - LOG.debug("Plugin already loaded: exception ignored: " + e.getMessage()); + // FB Core plugin is always loaded, so we'll get an exception for it always + if (!FINDBUGS_CORE_PLUGIN_ID.equals(e.getPluginId())) { + // log only if it's not the FV Core plugin + LOG.debug("Plugin already loaded: exception ignored: " + e.getMessage()); + } } } -- 2.39.5