Full_Name: Jim Willeke Version: N/A OS: Several URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (67.76.26.2)
This code:
String o1="cn=admin, ou=marketing, o=corporation"; String o2="ou=marketing, o=corporation"; DN dn1 = new DN(o1.toString()); DN dn2 = new DN(o2.toString()); if(dn1.isDescendantOf(dn2)) { System.out.println(dn1 + " isDescendantOf "+ dn2); } if(dn2.isDescendantOf(dn1)) { System.out.println(dn2 + " isDescendantOf "+ dn1); } o1="ou=marketing, o=corporation"; o2="cn=admin, ou=marketing, o=corporation"; dn1 = new DN(o1.toString()); dn2 = new DN(o2.toString()); if(dn1.isDescendantOf(dn2)) { System.out.println(dn1 + " isDescendantOf "+ dn2); } if(dn2.isDescendantOf(dn1)) { System.out.println(dn2 + " isDescendantOf "+ dn1); }
Yields these results: ou=marketing,o=corporation isDescendantOf cn=admin,ou=marketing,o=corporation ou=marketing,o=corporation isDescendantOf cn=admin,ou=marketing,o=corporation
Sure looks wrong to me.