LDAP-151 DistinguishedName violates the equals()/hashCode() contract
This commit is contained in:
@@ -161,7 +161,7 @@ public class LdapRdnComponent implements Comparable, Serializable {
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public int hashCode() {
|
||||
return key.hashCode() ^ value.hashCode();
|
||||
return key.toUpperCase().hashCode() ^ value.toUpperCase().hashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -140,8 +140,8 @@ public class DistinguishedNameTest extends TestCase {
|
||||
// original object
|
||||
final Object originalObject = new DistinguishedName("cn=john.doe, OU=Users,OU=Some company,C=SE");
|
||||
|
||||
// another object that has the same values as the original
|
||||
final Object identicalObject = new DistinguishedName("cn=john.doe, OU=Users,OU=Some company,C=SE");
|
||||
// another object that has the same values as the original (case is ignored)
|
||||
final Object identicalObject = new DistinguishedName("cn=john.doe, OU=Users,OU=SOME COMPANY,C=SE");
|
||||
|
||||
// another object with different values
|
||||
final Object differentObject = new DistinguishedName("cn=john.doe, OU=Users,OU=Some other company,C=SE");
|
||||
|
||||
Reference in New Issue
Block a user