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 2009/10/25 15:24:58 UTC

DO NOT REPLY [Bug 48049] New: org.apache.naming.NamingContext's destroySubcontext() method doesn't invoke itself recursively, but invoke unbind() method

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

           Summary: org.apache.naming.NamingContext's destroySubcontext()
                    method doesn't  invoke itself recursively, but invoke
                    unbind() method
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: qingyang.xu@qunar.com


Below is the original implementation of destroySubcontext(Name name) method:

public void destroySubcontext(Name name)
        throws NamingException {

        checkWritable();

        while ((!name.isEmpty()) && (name.get(0).length() == 0))
            name = name.getSuffix(1);
        if (name.isEmpty())
            throw new NamingException
                (sm.getString("namingContext.invalidName"));

        NamingEntry entry = (NamingEntry) bindings.get(name.get(0));

        if (entry == null) {
            throw new NameNotFoundException
                (sm.getString("namingContext.nameNotBound", name.get(0)));
        }

        if (name.size() > 1) {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).unbind(name.getSuffix(1));
            } else {
                throw new NamingException
                    (sm.getString("namingContext.contextExpected"));
            }
        } else {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).close();
                bindings.remove(name.get(0));
            } else {
                throw new NotContextException
                    (sm.getString("namingContext.contextExpected"));
            }
        }

    }


However, the method invokes 'unbind' method rather than invokes itself
recursively. 

if (name.size() > 1) {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).unbind(name.getSuffix(1));
            } else {
                throw new NamingException
                    (sm.getString("namingContext.contextExpected"));
            }

should be: 

if (name.size() > 1) {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).destroySubcontext(name.getSuffix(1));
            } else {
                throw new NamingException
                    (sm.getString("namingContext.contextExpected"));
            }

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 48049] org.apache.naming.NamingContext's destroySubcontext() method doesn't invoke itself recursively, but invoke unbind() method

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48049

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> 2010-01-27 00:39:10 UTC ---
Fixed in 5.5, will be in 5.5.29 onwards. Thank you.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 48049] org.apache.naming.NamingContext's destroySubcontext() method doesn't invoke itself recursively, but invoke unbind() method

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48049

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Catalina                    |Catalina
            Version|6.0.20                      |5.5.28
            Product|Tomcat 6                    |Tomcat 5
   Target Milestone|default                     |---

--- Comment #2 from Mark Thomas <ma...@apache.org> 2009-12-16 03:38:25 GMT ---
This has been fixed in 6.0.x and will be in 6.0.21 onwards.

Thanks again for the patch.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 48049] org.apache.naming.NamingContext's destroySubcontext() method doesn't invoke itself recursively, but invoke unbind() method

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48049

--- Comment #1 from Mark Thomas <ma...@apache.org> 2009-11-22 14:58:51 GMT ---
Thanks for the patch. It has been committed to trunk and proposed for 6.0.x and
5.5.x

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org