Index: modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java =================================================================== --- modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java (revision 548257) +++ modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java (working copy) @@ -23,10 +23,8 @@ */ package org.apache.harmony.jndi.tests.javax.naming.ldap; -import java.lang.reflect.Array; import java.util.ArrayList; import java.util.NoSuchElementException; -import java.util.concurrent.atomic.AtomicIntegerArray; import javax.naming.InvalidNameException; import javax.naming.NamingEnumeration; @@ -735,6 +733,26 @@ int y = new Rdn("T=TEST\\, THAT+S=THIS").hashCode(); assertNotSame(0, x & y); assertEquals(x, y); + } + + /** + *
+ * Test method for 'javax.naming.ldap.Rdn.hashCode()' + *
+ *+ * Here we are testing if this method returns the hash code of this RDN, in + * this case we are testing if the hashcode returned by this method is the + * correct one, the only hash that we know something is of the Rdn empty, + * this hash has to be zero. + *
+ *+ * The expected result is the hashcode of the rdn. + *
+ */ + public void testHashCode002() throws Exception { + int x = new Rdn("t= #20").hashCode(); + int y = new Rdn("t= #20").hashCode(); + assertTrue(x == y); } /** Index: modules/jndi/src/main/java/javax/naming/ldap/Rdn.java =================================================================== --- modules/jndi/src/main/java/javax/naming/ldap/Rdn.java (revision 548257) +++ modules/jndi/src/main/java/javax/naming/ldap/Rdn.java (working copy) @@ -68,7 +68,7 @@ return LdapRdnParser.unescapeValue(val); } - private List