[PATCH] jndikit

Alex Turc <[email protected]> 22 Jul 2003 15:42:12 +0300
Newsgroups gmane.comp.java.spice.devel
Message-ID <1058877732.25378.188.camel@patrocle>
Hi

I suggest the following patch for AbstractURLContext.java.

Explanation:  If the name argument of the getBaseURLContext method is a
CompositeName (as it is this implementation), calling toString on it
encloses each name component in quotes, which conflicts with the string
parsing algorithm that follows. I'v changed to extract and use the first
name component. The jndi tutorial at
http://java.sun.com/products/jndi/tutorial/provider/url/context.html
suggest this kind of implementation.

Alex.
AbstractURLContext.java.diff (text/x-patch, 706 B)
Index: AbstractURLContext.java
===================================================================
RCS file: /cvsroot/spice/spice/components/jndikit/src/java/org/realityforge/jndikit/AbstractURLContext.java,v
retrieving revision 1.2
diff -u -w -b -r1.2 AbstractURLContext.java
--- AbstractURLContext.java	24 May 2003 23:56:54 -0000	1.2
+++ AbstractURLContext.java	22 Jul 2003 11:56:27 -0000
@@ -220,7 +220,7 @@
             throw new InvalidNameException( "Unable to locate URLContext will empty name" );
         }
 
-        final String nameString = name.toString();
+        final String nameString = name.get(0).toString();
         int index = nameString.indexOf( ':' );
 
         if( -1 == index )