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 2006/01/05 02:47:23 UTC

svn commit: r366053 - /directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java

Author: elecharny
Date: Wed Jan  4 17:47:12 2006
New Revision: 366053

URL: http://svn.apache.org/viewcvs?rev=366053&view=rev
Log:
- Fixed a bug in computeLength() with null values attributes
- Fixed a bug in toString() : attributes were not dumped

Modified:
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java?rev=366053&r1=366052&r2=366053&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/search/SearchResultEntry.java Wed Jan  4 17:47:12 2006
@@ -276,6 +276,14 @@
 
                         localAttributeLength += 1 + Length.getNbBytes( localValuesLength ) + localValuesLength; 
 	                }
+	                else
+	                {
+	                	// We have to deal with the special wase where
+	                	// we don't have a value.
+	                	// It will be encoded as an empty OCTETSTRING,
+	                	// so it will be two byte slong (0x04 0x00)
+	                	localAttributeLength += 1 + 1;
+	                }
 	                
                 }
                 catch (NamingException ne)
@@ -425,7 +433,7 @@
         }
         else
         {
-            AttributeUtils.toString( "            ", partialAttributeList );
+            sb.append( AttributeUtils.toString( "            ", partialAttributeList ) );
         }
 
         return sb.toString();