You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2011/06/30 11:13:05 UTC

Is Dn(Dn) useful ?

Hi guys,

this morning, I found a pretty big big in the Dn class. Doing something 
like :

Dn original = new Dn( schemaManager, "dc=example, dc=org" );
Dn copy = new Dn( original );

System.out.println( "Original DN : " + original );
System.out.println( "Copied DN : " + copy );

produces :

Original DN : dc=example, dc=org
Copied DN : dc=org, dc=example

Ok, the rdns are just copied in the reverse order. At first, I thought 
"WTF ? Why are the tests passing?" then Pierre-Arnaud replied :"Who 
cares to copy a Dn ? It's an immutable class anyway..." and I think he 
is plain on spot.

Should we remove the copy constructor (which seems not to be used 
anywhere ) ?

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Is Dn(Dn) useful ?

Posted by Kiran Ayyagari <ka...@apache.org>.
On Thu, Jun 30, 2011 at 2:43 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Hi guys,
>
> this morning, I found a pretty big big in the Dn class. Doing something like
> :
>
> Dn original = new Dn( schemaManager, "dc=example, dc=org" );
> Dn copy = new Dn( original );
>
> System.out.println( "Original DN : " + original );
> System.out.println( "Copied DN : " + copy );
>
> produces :
>
> Original DN : dc=example, dc=org
> Copied DN : dc=org, dc=example
>
> Ok, the rdns are just copied in the reverse order. At first, I thought "WTF
> ? Why are the tests passing?" then Pierre-Arnaud replied :"Who cares to copy
> a Dn ? It's an immutable class anyway..." and I think he is plain on spot.
>
hehe, +1 let us get rid of it
> Should we remove the copy constructor (which seems not to be used anywhere )
> ?
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>



-- 
Kiran Ayyagari