diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-03-15 22:08:46 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-03-15 22:08:46 +0100 |
commit | 1337f4f81fc1b3792a206e5589f9e80ec9250635 (patch) | |
tree | 8c743bb273dfb083144999cb92e7a72496c7613b /sonar-plugin-api/src | |
parent | 4dcb364cf76f305445a8fe596039096e02c398cb (diff) | |
download | sonarqube-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.java | 4 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java | 1 |
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); } |