Index: modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java =================================================================== --- modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java (revision 537693) +++ modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java (working copy) @@ -3275,6 +3275,23 @@ /** *

+ * Test method for 'javax.naming.ldap.LdapName.remove(int)' + *

+ *

+ * Here we are testing if this method removes a component from this LDAP + * name. + *

+ *

+ * The expected result is an index out of boundary exception. + *

+ */ + public void testRemove006() throws Exception { + LdapName ln = new LdapName("t=test, t1=test1"); + assertEquals("t=test", (String)ln.remove(1)); + } + + /** + *

* Test method for 'javax.naming.ldap.LdapName.getRdns()' *

*

Index: modules/jndi/src/main/java/javax/naming/ldap/LdapName.java =================================================================== --- modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (revision 537693) +++ modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (working copy) @@ -322,7 +322,7 @@ * @ar.org.fitc.spec_ref */ public Object remove(int posn) throws InvalidNameException { - return rdns.remove(posn); + return rdns.remove(posn).toString(); } /**