[SJN-58] Unable to create subcontexts | |
| Status: | Closed |
| Project: | Simple-JNDI |
| Component/s: | |
| Affects Version/s: | |
| Fix Version/s: | 0.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Henri Yandell | Assignee: | Robert M. Zigweid |
| Resolution: | Fixed | ||
| Environment: | |||
| Description |
| The new GenericContext seems to have a problem with subcontexts. From email to Robert a while back: **** If I were to do: Context tmp = ctxt.createSubcontext("path"); tmp = tmp.createSubcontext("one"); tmp = tmp.createSubcontext("two"); It gives me a NotContextException in getNameParser. ============= I think the problem is in the method getNameParse(Name);NameParser (line 623 of AbstractContext). For a hierarchy of 'path/one/two' when creating the 'two' subcontext, that method is given a Name of 'path/one'. It then attempts to find the name in the subcontext, which it won't be. It needs to somehow talk to the parent subcontext, and it needs to pass in "one" and not "path" as it currently is (getPrefix(1) should become getSuffix(name.size()-1)). Also, in GenericContext, in createSubcontext(Name);Context, line 142, I think there should be a bind(name, newContext) after line 150. I'll commit my failing unit test. **************** The unit test was committed and currently fails. |
| Comment by tigran [ Thu, 2 Jun 2005 03:49:06 -0700 (PDT) ] |
| Fixed the NameParser lookup. r1727 |
| Comment by bayard [ Thu, 29 Sep 2005 11:48:02 -0700 (PDT) ] |
| Done |