summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-03-15 22:08:46 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2013-03-15 22:08:46 +0100
commit1337f4f81fc1b3792a206e5589f9e80ec9250635 (patch)
tree8c743bb273dfb083144999cb92e7a72496c7613b /sonar-plugin-api/src
parent4dcb364cf76f305445a8fe596039096e02c398cb (diff)
downloadsonarqube-1337f4f81fc1b3792a206e5589f9e80ec9250635.tar.gz
sonarqube-1337f4f81fc1b3792a206e5589f9e80ec9250635.zip
Fix shutdown of ComponentContainer on error
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java4
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java1
2 files changed, 1 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java
index 593e5a30b4c..aef6b5bc960 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java
@@ -124,9 +124,7 @@ public class ComponentContainer implements BatchComponent, ServerComponent {
throw PicoUtils.propagate(e);
}
} finally {
- if (parent != null) {
- parent.removeChild();
- }
+ removeChild();
}
return this;
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java
index 6bf96d37def..22d386326e4 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java
@@ -43,7 +43,6 @@ public class ComponentContainerTest {
@Test
public void shouldRegisterItself() {
ComponentContainer container = new ComponentContainer();
-
assertThat(container.getComponentByType(ComponentContainer.class)).isSameAs(container);
}