directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r596800 - /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDnParser.java
Date Tue, 20 Nov 2007 19:46:03 GMT
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 ) );
        }
    }
 



Mime
View raw message