On 02/01/2012 11:58 PM, Alex Karasulu wrote: > On Wed, Feb 1, 2012 at 10:19 PM, Christoph Czurda > <[email protected]>wrote: > >> Hi Pierre-Arnaud, >> >> The mistake was on my side. I used Rdn rdn = new Rdn("cn=a,ou=b"); and >> passed this to a Dn constructor. I misinterpreted the description of >> class Rdn where it says that any String with a '=' is treated as a full >> Rdn. When I changed it, it worked as expected. >> >> > Just curious can you show me the offending code? I really did not > understand your description. > > I ask this because it might show which area of our API is weak in terms of > being intuitive. If the user understands the domain a good API shows > exactly how it should be used by the object model and methods. > > It was like this: Dn parent = new Dn("ou=system"); Dn somewhereBelow = new Dn(new Rdn("cn=a,cn=b"),parent); //the problem was the rdn
I thought that in this constructor everything before the parent is simply prepended. The interesting thing is that dn.getName() did what I actually intended, ie it returns "cn=a,cn=b,ou=system". Kind regards, Christoph
