You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2019/07/02 08:54:40 UTC

[directory-ldap-api] branch master updated: Fix the BindRequest toString() method which was not exposing the name

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


The following commit(s) were added to refs/heads/master by this push:
     new cda4807  Fix the BindRequest toString() method which was not exposing the name
cda4807 is described below

commit cda4807c78401fb3c3e2a0cc2cd93b73c023eef2
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jul 2 10:54:36 2019 +0200

    Fix the BindRequest toString() method which was not exposing the name
---
 .../api/ldap/model/message/BindRequestImpl.java    | 32 ++++++++++------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/BindRequestImpl.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/BindRequestImpl.java
index 1768969..67dfd6b 100644
--- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/BindRequestImpl.java
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/BindRequestImpl.java
@@ -469,32 +469,30 @@ public BindRequest setName( String name )
         sb.append( "    BindRequest\n" );
         sb.append( "        Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
 
-        if ( ( ( Strings.isEmpty( name ) ) || ( dn == null ) || dn.equals( Dn.EMPTY_DN ) )
-            && isSimple )
+        if ( isSimple )
         {
-            sb.append( "        Name : anonymous\n" );
+            if ( ( Strings.isEmpty( name ) && ( ( dn == null ) || dn.equals( Dn.EMPTY_DN ) ) ) )
+            {
+                sb.append( "        Name : anonymous\n" );
+            }
+            else
+            {
+                sb.append( "        Name : '" ).append( name ).append( "'\n" );
+                sb.append( "        Simple authentication : '" ).append( "(omitted-for-safety)" ).append( "'\n" );
+            }
         }
         else
         {
-            sb.append( "        Name : '" ).append( name ).append( "'\n" );
+            sb.append( "        Sasl credentials\n" );
+            sb.append( "            Mechanism :'" ).append( mechanism ).append( "'\n" );
 
-            if ( isSimple )
+            if ( credentials == null )
             {
-                sb.append( "        Simple authentication : '" ).append( "(omitted-for-safety)" ).append( "'\n" );
+                sb.append( "            Credentials : null" );
             }
             else
             {
-                sb.append( "        Sasl credentials\n" );
-                sb.append( "            Mechanism :'" ).append( mechanism ).append( "'\n" );
-
-                if ( credentials == null )
-                {
-                    sb.append( "            Credentials : null" );
-                }
-                else
-                {
-                    sb.append( "            Credentials : (omitted-for-safety)" );
-                }
+                sb.append( "            Credentials : (omitted-for-safety)" );
             }
         }