From baf179c880116bdf1f0216ae38232e6a2adc343c Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Sat, 16 Mar 2013 10:48:15 +0100 Subject: [PATCH] Fix stop of ComponentContainer with child --- .../org/sonar/api/platform/ComponentContainer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 aef6b5bc960..88d253f005d 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 @@ -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; } -- 2.39.5