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 548914) +++ modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java (working copy) @@ -2268,6 +2268,24 @@ /** *

+ * Test method for 'javax.naming.ldap.LdapName.endsWith(List)' + *

+ *

+ * Here we are testing if this method determines whether the specified RDN + * sequence forms a suffix of this LDAP name. + *

+ *

+ * The expected result is if a non null list of Rdns is sended, is a true. + *

+ */ + public void testEndsWithListOfRdn007() throws Exception { + LinkedList test = new LinkedList(); + test.add(new Rdn("t3=test3")); + assertTrue(new LdapName("t3=test3,t2=test2,t=test").endsWith(test)); + } + + /** + *

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

*

Index: modules/jndi/src/main/java/javax/naming/ldap/LdapName.java =================================================================== --- modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (revision 548914) +++ modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (working copy) @@ -204,7 +204,7 @@ public boolean endsWith(List rdns) { try { Iterator iter = rdns.iterator(); - Iterator iter2 = ((LdapName) getSuffix(rdns.size() + Iterator iter2 = ((LdapName) getSuffix(this.rdns.size() - rdns.size())).rdns.iterator(); while (iter.hasNext()) {