Author: remy.maucherat(a)jboss.com
Date: 2009-09-02 08:50:53 -0400 (Wed, 02 Sep 2009)
New Revision: 1161
Modified:
trunk/java/org/apache/catalina/core/ContainerBase.java
trunk/java/org/apache/catalina/core/LocalStrings.properties
Log:
- Concurrent hash map does not like null keys, so be stricter.
Modified: trunk/java/org/apache/catalina/core/ContainerBase.java
===================================================================
--- trunk/java/org/apache/catalina/core/ContainerBase.java 2009-09-02 09:29:45 UTC (rev
1160)
+++ trunk/java/org/apache/catalina/core/ContainerBase.java 2009-09-02 12:50:53 UTC (rev
1161)
@@ -862,9 +862,10 @@
if( log.isDebugEnabled() )
log.debug("Add child " + child + " " + this);
+ if (child.getName() == null)
+ throw new
IllegalArgumentException(sm.getString("containerBase.addChild.nullName"));
if (children.get(child.getName()) != null)
- throw new IllegalArgumentException("addChild: Child name '" +
- child.getName() + "' is not unique");
+ throw new
IllegalArgumentException(sm.getString("containerBase.addChild.notUnique",
child.getName()));
child.setParent(this); // May throw IAE
children.put(child.getName(), child);
@@ -876,9 +877,7 @@
((Lifecycle) child).start();
success = true;
} catch (LifecycleException e) {
- log.error("ContainerBase.addChild: start: ", e);
- throw new IllegalStateException
- ("ContainerBase.addChild: start: " + e);
+ throw new
IllegalStateException(sm.getString("containerBase.addChild.start",
child.getName()), e);
} finally {
if (!success) {
children.remove(child.getName());
Modified: trunk/java/org/apache/catalina/core/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/catalina/core/LocalStrings.properties 2009-09-02 09:29:45 UTC
(rev 1160)
+++ trunk/java/org/apache/catalina/core/LocalStrings.properties 2009-09-02 12:50:53 UTC
(rev 1161)
@@ -55,6 +55,9 @@
containerBase.backgroundProcess.realm=Exception processing realm {0} background process
containerBase.backgroundProcess.valve=Exception processing valve {0} background process
containerBase.backgroundProcess.jarRepository=Exception processing jar repository {0}
background process
+containerBase.addChild.nullName=Child container name cannot be null
+containerBase.addChild.notUnique=Child container with name {0} already exists
+containerBase.addChild.start=Failed to start child container {0}
fastEngineMapper.alreadyStarted=FastEngineMapper {0} has already been started
fastEngineMapper.notStarted=FastEngineMapper {0} has not yet been started
filterChain.filter=Filter execution threw an exception