aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-05-26 17:01:40 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-06-01 17:08:28 +0200
commit71aa31687b92b01207931c075613b6608abdb120 (patch)
treeca63f0d0fb5c0ca0d90b24baa21d2987baccda1b /sonar-core
parentbe8707ef18df79c56b14d8296a0955a6f81eae89 (diff)
downloadsonarqube-71aa31687b92b01207931c075613b6608abdb120.tar.gz
sonarqube-71aa31687b92b01207931c075613b6608abdb120.zip
SONAR-6589 remove ComputationContainer (and use only CEContainer)
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
index e0bafcf8e9c..d6a2a258a75 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
@@ -50,9 +50,13 @@ public class ComponentContainer {
* Create root container
*/
public ComponentContainer() {
+ this(createPicoContainer());
+ }
+
+ protected ComponentContainer(MutablePicoContainer picoContainer) {
this.parent = null;
this.child = null;
- this.pico = createPicoContainer();
+ this.pico = picoContainer;
this.componentKeys = new ComponentKeys();
propertyDefinitions = new PropertyDefinitions();
addSingleton(propertyDefinitions);
@@ -63,15 +67,8 @@ public class ComponentContainer {
* Create child container
*/
protected ComponentContainer(ComponentContainer parent) {
- this(parent.pico.makeChildContainer(), parent);
- }
-
- /**
- * Create child container
- */
- protected ComponentContainer(MutablePicoContainer picoContainer, ComponentContainer parent) {
this.parent = parent;
- this.pico = picoContainer;
+ this.pico = parent.pico.makeChildContainer();
this.parent.child = this;
this.propertyDefinitions = parent.propertyDefinitions;
this.componentKeys = new ComponentKeys();
@@ -216,8 +213,8 @@ public class ComponentContainer {
return this;
}
- public <T> T getComponentByType(Class<T> tClass) {
- return pico.getComponent(tClass);
+ public <T> T getComponentByType(Class<T> type) {
+ return pico.getComponent(type);
}
public Object getComponentByKey(Object key) {