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 2007/11/20 21:21:31 UTC
Re: svn commit: r596800 - /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java
Very good catch, Felix !!! I missed the point when I changed the code
last month.
Thanks !
felixk@apache.org wrote:
> Author: felixk
> Date: Tue Nov 20 11:46:03 2007
> New Revision: 596800
>
> URL: http://svn.apache.org/viewvc?rev=596800&view=rev
> Log:
> Invocation of toString on an array
>
> The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array.
>
> Modified:
> directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java
>
> Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java
> URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java?rev=596800&r1=596799&r2=596800&view=diff
> ==============================================================================
> --- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java (original)
> +++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java Tue Nov 20 11:46:03 2007
> @@ -20,6 +20,7 @@
> package org.apache.directory.shared.ldap.name;
>
>
> +import java.util.Arrays;
> import java.util.List;
>
> import javax.naming.InvalidNameException;
> @@ -150,7 +151,7 @@
>
> if ( pos.start != dn.length )
> {
> - throw new InvalidNameException( "Bad DN : " + dn );
> + throw new InvalidNameException( "Bad DN : " + Arrays.toString( dn ) );
> }
> else
> {
> @@ -162,11 +163,11 @@
> }
> while ( RdnParser.parse( dn, pos, rdn ) != DNUtils.PARSING_ERROR );
>
> - throw new InvalidNameException( "Bad DN : " + dn );
> + throw new InvalidNameException( "Bad DN : " + Arrays.toString( dn ) );
> }
> else
> {
> - throw new InvalidNameException( "Bad DN : " + dn );
> + throw new InvalidNameException( "Bad DN : " + Arrays.toString( dn ) );
> }
> }
>
>
>
>
>
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org