On 02/02/2012 12:18 AM, Alex Karasulu wrote: > On Thu, Feb 2, 2012 at 1:14 AM, Christoph Czurda > <hasnoadditi...@gmail.com>wrote: > >> On 02/01/2012 11:58 PM, Alex Karasulu wrote: >>> On Wed, Feb 1, 2012 at 10:19 PM, Christoph Czurda >>> <hasnoadditi...@gmail.com>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. > > > So if understand correctly you thought Rdn is not a single name component > but one that can have 1 or more name components like for example a relative > path in the fs namespace? > Well, I was aware that a Rdn only relates to the lowest Ava of a Dn. I mixed up the following:
>From api documentation of constructor public Dn(String... upRdns): If the String contains a '=' symbol, the the constructor will assume that the String arg contains afull Rdn, otherwise, it will consider that the following arg is the value. So I thought if this works for a Dn, it might as well work for a Rdn. Maybe the Rdn constructor should throw an InvalidDnException if it is passed a String containing more than one '='. > >> The interesting thing is that dn.getName() did what I >> actually intended, ie it returns "cn=a,cn=b,ou=system". >> >> > Odd. > > Thanks for the feedback. >