You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/07/17 05:00:09 UTC

DO NOT REPLY [Bug 35769] New: - Wrong implementation of javax.naming.Context.composeName

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35769>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35769

           Summary: Wrong implementation of javax.naming.Context.composeName
           Product: Tomcat 4
           Version: 4.1.31
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: asfBugzilla.stratic@spamgourmet.com


The implementation of javax.naming.Context.composeName( Name, Name) is wrong and
return erroneous results.

In following classes:
- org.apache.naming.NamingContext
- org.apache.naming.BaseDirContext
- org.apache.naming.ProxyDirContext
- org.apache.naming.SelectorContext

The current implementation is:

    public Name composeName(Name name, Name prefix)
    throws NamingException {
	prefix = (Name) name.clone();   // here is the error
	return prefix.addAll(name);
    }

So, on a Context ctx
A call like ctx.composeName("foo/bar", "example/prefix")	
might return a Name like "example/prefix/foo/bar"
but actually return "foo/bar/foo/bar" !

The correct implementation is:

    public Name composeName(Name name, Name prefix)
    throws NamingException {
	prefix = (Name) prefix.clone();
	return prefix.addAll(name);
    }

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

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