]> source.dussan.org Git - sonarqube.git/commitdiff
Fix stop of ComponentContainer with child
authorSimon Brandhof <simon.brandhof@gmail.com>
Sat, 16 Mar 2013 09:48:15 +0000 (10:48 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Sat, 16 Mar 2013 09:48:15 +0000 (10:48 +0100)
sonar-plugin-api/src/main/java/org/sonar/api/platform/ComponentContainer.java

index aef6b5bc9608e9c693f2df3ffcf68517ca2a8785..88d253f005d25ca11fa35c7fe5bf2f7f52c90f7e 100644 (file)
@@ -117,14 +117,18 @@ public class ComponentContainer implements BatchComponent, ServerComponent {
 
   public ComponentContainer stopComponents(boolean swallowException) {
     try {
-      pico.stop();
+      if (!pico.getLifecycleState().isStopped()) {
+        pico.stop();
+      }
+      removeChild();
+      if (parent!=null) {
+        parent.removeChild();
+      }
 
     } catch (RuntimeException e) {
       if (!swallowException) {
         throw PicoUtils.propagate(e);
       }
-    } finally {
-      removeChild();
     }
     return this;
   }