directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328306 - /directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java
Date Tue, 25 Oct 2005 07:51:34 GMT
Author: elecharny
Date: Tue Oct 25 00:51:30 2005
New Revision: 328306

URL: http://svn.apache.org/viewcvs?rev=328306&view=rev
Log:
Fixed the toString() method

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java?rev=328306&r1=328305&r2=328306&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java
Tue Oct 25 00:51:30 2005
@@ -24,6 +24,7 @@
 import org.apache.asn1new.ber.tlv.Value;
 import org.apache.asn1new.ldap.codec.LdapConstants;
 import org.apache.asn1new.ldap.codec.primitives.LdapDN;
+import org.apache.asn1new.util.StringUtils;
 
 
 /**
@@ -254,19 +255,27 @@
 
         sb.append( "    BindRequest\n" );
         sb.append( "        Version : '" ).append( version ).append( "'\n" );
-        sb.append( "        Name : '" ).append( name.toString() ).append( "'\n" );
-
-        if ( authentication instanceof SimpleAuthentication )
+        
+        if ( StringUtils.isEmpty( name.toString() ) )
         {
-            sb.append( "        Simple authentication : '" )
-              .append( ( ( SimpleAuthentication ) authentication ).toString() ).append(
-                "'\n" );
+            sb.append( "        Name : anonymous\n" );
         }
         else
         {
-            sb.append( ( ( SaslCredentials ) authentication ).toString() );
+            sb.append( "        Name : '" ).append( name.toString() ).append( "'\n" );
+    
+            if ( authentication instanceof SimpleAuthentication )
+            {
+                sb.append( "        Simple authentication : '" )
+                  .append( ( ( SimpleAuthentication ) authentication ).toString() ).append(
+                    "'\n" );
+            }
+            else
+            {
+                sb.append( ( ( SaslCredentials ) authentication ).toString() );
+            }
         }
-
+        
         return sb.toString();
     }
 }



Mime
View raw message