diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-30 09:37:00 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-30 09:37:00 +0000 |
commit | 4b6828f0e98b5284ff0eacda9bcd8796bc6b8d10 (patch) | |
tree | 989aa8f3238b316c78741b186d8acdb1fdbef4eb /sonar-core/src | |
parent | 2c7c234cf1cf4c8b104b970a5cad30089cb6c043 (diff) | |
download | sonarqube-4b6828f0e98b5284ff0eacda9bcd8796bc6b8d10.tar.gz sonarqube-4b6828f0e98b5284ff0eacda9bcd8796bc6b8d10.zip |
the property sonar.core.codeCoveragePlugin is not used when it's set from UI console
Diffstat (limited to 'sonar-core/src')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/plugin/AbstractPluginRepository.java | 5 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/plugin/AbstractPluginRepositoryTest.java | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/plugin/AbstractPluginRepository.java b/sonar-core/src/main/java/org/sonar/core/plugin/AbstractPluginRepository.java index 9a15c9e06ba..a1e51e95d9a 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugin/AbstractPluginRepository.java +++ b/sonar-core/src/main/java/org/sonar/core/plugin/AbstractPluginRepository.java @@ -24,6 +24,7 @@ import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; import org.picocontainer.Characteristics; import org.picocontainer.MutablePicoContainer; +import org.picocontainer.PicoContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.*; @@ -70,7 +71,7 @@ public abstract class AbstractPluginRepository implements PluginRepository { } private void registerExtension(MutablePicoContainer container, Plugin plugin, String pluginKey, Object extension) { - if (shouldRegisterExtension(pluginKey, extension)) { + if (shouldRegisterExtension(container, pluginKey, extension)) { LOG.debug("Register the extension: {}", extension); container.as(Characteristics.CACHE).addComponent(getExtensionKey(extension), extension); pluginByExtension.put(extension, plugin); @@ -78,7 +79,7 @@ public abstract class AbstractPluginRepository implements PluginRepository { } } - protected abstract boolean shouldRegisterExtension(String pluginKey, Object extension); + protected abstract boolean shouldRegisterExtension(PicoContainer container, String pluginKey, Object extension); public Collection<Plugin> getPlugins() { return pluginByKey.values(); diff --git a/sonar-core/src/test/java/org/sonar/core/plugin/AbstractPluginRepositoryTest.java b/sonar-core/src/test/java/org/sonar/core/plugin/AbstractPluginRepositoryTest.java index de2343a07f5..6e1aa0d93de 100644 --- a/sonar-core/src/test/java/org/sonar/core/plugin/AbstractPluginRepositoryTest.java +++ b/sonar-core/src/test/java/org/sonar/core/plugin/AbstractPluginRepositoryTest.java @@ -21,6 +21,7 @@ package org.sonar.core.plugin; import org.junit.Test; import org.picocontainer.MutablePicoContainer; +import org.picocontainer.PicoContainer; import org.sonar.api.BatchExtension; import org.sonar.api.ExtensionProvider; import org.sonar.api.Plugin; @@ -72,7 +73,7 @@ public class AbstractPluginRepositoryTest { MutablePicoContainer pico = IocContainer.buildPicoContainer(); AbstractPluginRepository repository = new AbstractPluginRepository() { @Override - protected boolean shouldRegisterExtension(String pluginKey, Object extension) { + protected boolean shouldRegisterExtension(PicoContainer container, String pluginKey, Object extension) { return isType(extension, ServerExtension.class); } }; |