You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/03/04 13:05:06 UTC

svn commit: r918957 - in /tomcat/trunk/java/org/apache/naming: LocalStrings.properties NamingContext.java

Author: markt
Date: Thu Mar  4 12:05:06 2010
New Revision: 918957

URL: http://svn.apache.org/viewvc?rev=918957&view=rev
Log:
Revert r917784 and r905722 - changes associated with the invalid bug 48050

Modified:
    tomcat/trunk/java/org/apache/naming/LocalStrings.properties
    tomcat/trunk/java/org/apache/naming/NamingContext.java

Modified: tomcat/trunk/java/org/apache/naming/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/LocalStrings.properties?rev=918957&r1=918956&r2=918957&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/naming/LocalStrings.properties Thu Mar  4 12:05:06 2010
@@ -19,7 +19,6 @@
 selectorContext.noJavaUrl=This context must be accessed through a java: URL
 selectorContext.methodUsingName=Call to method ''{0}'' with a Name of ''{1}''
 selectorContext.methodUsingString=Call to method ''{0}'' with a String of ''{1}''
-namingContext.createSubContextInvalid=Unable to create context with name [{0}] as a sub-context of the context named [{1}]
 namingContext.contextExpected=Name is not bound to a Context
 namingContext.failResolvingReference=Unexpected exception resolving reference
 namingContext.nameNotBound=Name {0} is not bound in this Context

Modified: tomcat/trunk/java/org/apache/naming/NamingContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContext.java?rev=918957&r1=918956&r2=918957&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContext.java Thu Mar  4 12:05:06 2010
@@ -505,14 +505,11 @@
 
     /**
      * Creates and binds a new context. Creates a new context with the given 
-     * name and binds it in this context.
-     * 
-     * @param name The name of the context to create; may not be empty.  If the
-     *             name consists of a single component then the sub-context is
-     *             created with a prefix of the name of this context. If the
-     *             name has multiple components then name.prefix(name.size()-1)
-     *             must be the name of this context.
+     * name and binds it in the target context (that named by all but 
+     * terminal atomic component of the name). All intermediate contexts and 
+     * the target context must already exist.
      * 
+     * @param name the name of the context to create; may not be empty
      * @return the newly created context
      * @exception NameAlreadyBoundException if name is already bound
      * @exception InvalidAttributesException if creation of the subcontext 
@@ -523,25 +520,8 @@
         throws NamingException {
         checkWritable();
         
-        String contextName = null;
-        
-        if (name.size() == 1) {
-            if (this.name.endsWith("/")) {
-                contextName = this.name + name.get(0);
-            } else {
-                contextName = this.name + "/" + name.get(0);
-            }
-        } else {
-            if (!name.getPrefix(name.size()-1).toString().equals(name)) {
-                throw new NamingException(
-                        sm.getString("namingContext.createSubContextInvalid",
-                                name, this.name));
-            }
-            contextName = name.toString();
-        }
-        
-        Context newContext = new NamingContext(env, contextName);
-        bind(name.getSuffix(name.size() -1), newContext);
+        Context newContext = new NamingContext(env, this.name);
+        bind(name, newContext);
         
         return newContext;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org