aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2012-02-24 11:32:17 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2012-02-24 11:32:17 +0100
commitf1d9a26e64878b912694b404cf47fe84fecc688f (patch)
tree5e08bab5d67c05b430c9e0808b1dc838ff5a6050 /sonar-server
parent8924291b6d2fc829e5432d41ad998bed0ad4a89a (diff)
downloadsonarqube-f1d9a26e64878b912694b404cf47fe84fecc688f.tar.gz
sonarqube-f1d9a26e64878b912694b404cf47fe84fecc688f.zip
Fail server startup if an ExtensionProvider contains another ExtensionProvider
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/ServerExtensionInstaller.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/ServerExtensionInstaller.java b/sonar-server/src/main/java/org/sonar/server/plugins/ServerExtensionInstaller.java
index 9fb0dd8a7af..99847e02ef8 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/ServerExtensionInstaller.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/ServerExtensionInstaller.java
@@ -21,7 +21,6 @@ package org.sonar.server.plugins;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
-import org.slf4j.LoggerFactory;
import org.sonar.api.Extension;
import org.sonar.api.ExtensionProvider;
import org.sonar.api.Plugin;
@@ -80,11 +79,10 @@ public class ServerExtensionInstaller {
Object installExtension(ComponentContainer container, PluginMetadata pluginMetadata, Object extension, boolean acceptProvider) {
if (isType(extension, ServerExtension.class)) {
if (!acceptProvider && isExtensionProvider(extension)) {
- LoggerFactory.getLogger(getClass()).error("ExtensionProvider can not include providers itself: " + extension);
- } else {
- container.addExtension(pluginMetadata, extension);
- return extension;
+ throw new IllegalStateException("ExtensionProvider can not include providers itself: " + extension);
}
+ container.addExtension(pluginMetadata, extension);
+ return extension;
}
return null;
}