Author: markt Date: Tue May 10 08:40:01 2016 New Revision: 1743124 URL: http://svn.apache.org/viewvc?rev=1743124&view=rev Log: Ensure that the process to remove a child container is the reverse of the process to add one. Patch provided by Huxing Zhang.
Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1743124&r1=1743123&r2=1743124&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Tue May 10 08:40:01 2016 @@ -810,12 +810,6 @@ public abstract class ContainerBase exte return; } - synchronized(children) { - if (children.get(child.getName()) == null) - return; - children.remove(child.getName()); - } - try { if (child.getState().isAvailable()) { child.stop(); @@ -824,8 +818,6 @@ public abstract class ContainerBase exte log.error("ContainerBase.removeChild: stop: ", e); } - fireContainerEvent(REMOVE_CHILD_EVENT, child); - try { // child.destroy() may have already been called which would have // triggered this call. If that is the case, no need to destroy the @@ -837,6 +829,13 @@ public abstract class ContainerBase exte log.error("ContainerBase.removeChild: destroy: ", e); } + synchronized(children) { + if (children.get(child.getName()) == null) + return; + children.remove(child.getName()); + } + + fireContainerEvent(REMOVE_CHILD_EVENT, child); } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1743124&r1=1743123&r2=1743124&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue May 10 08:40:01 2016 @@ -217,6 +217,11 @@ <bug>59437</bug>: Ensure that the JASPIC <code>CallbackHandler</code> is thread-safe. (markt) </fix> + <fix> + <bug>59450</bug>: In <code>ContainerBase</code>, ensure that the process + to remove a child container is the reverse of the process to add one. + Patch provided by Huxing Zhang. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org