https://issues.apache.org/bugzilla/show_bug.cgi?id=48050

--- Comment #3 from Konstantin Kolinko <knst.koli...@gmail.com> 2010-03-04 
10:13:54 UTC ---
Please note, that this o.a.naming.NamingContext.name field is something
internal:
It is used to implement NamingContext.isWritable(), and it is *not* exposed
through any public API.

(though it is accessible to subclasses because of being protected)

NamingContext.isWritable() is implemented as readOnlyContexts.containsKey(name)
where readOnlyContexts is some Hashtable.

Note that the exact name is checked for being in readOnlyContexts table, not
some prefix of it.

Thus,
        Context newContext = new NamingContext(env, this.name);
        bind(name, newContext);
means that the new context
1) is bound to the name 'name'
2) shares the property of being read-only with the current context, thus
this.name

Thus, the current code is correct.


The JavaDoc for NamingContext.name property is
    /**
     * Name of the associated Catalina Context.
     */
    protected String name;

It does not say that it is name of this context, but explicitly says that the
name belongs to another object.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to