|
One word: patch. :). Give a committer a patch he can apply and well things get done faster. Take a look at svn diff.
Oh and a test case with the patch is also a good idea. We don't want to introduce things like NPE into the code just to print out strings.
Not a bug but a improvement I think.
Alex Karasulu made changes - 21/Feb/06 11:37 AM
method provided as a patch and, as suggested, added some defensive coding checks to avoid all possible NPEs
Norval Hope made changes - 21/Feb/06 02:58 PM
improved coding slightly after investigating precise coding of StringBuffer.append(Object)
Norval Hope made changes - 21/Feb/06 03:34 PM
Sorry guys, it's a valid concern, but it's already implemented :)
just set the following logger in log4j.properties file : org.apache.directory.shared.ldap.codec.TwixDecoder=DEBUG and you will get : [07:55:42] DEBUG [org.apache.directory.shared.ldap.codec.TwixDecoder] - Decoding the PDU : [07:55:42] DEBUG [org.apache.directory.shared.ldap.codec.TwixDecoder] - 0x30 0x3A 0x02 0x01 0x03 0x63 0x35 0x04 0x15 0x6F 0x75 0x3D 0x53 0x65 0x61 0x72 0x63 0x68 0x2C 0x20 0x6F 0x3D 0x49 0x4D 0x43 0x2C 0x63 0x3D 0x55 0x53 0x0A 0x01 0x00 0x0A 0x01 0x03 0x02 0x01 0x00 0x02 0x01 0x00 0x01 0x01 0x00 0x87 0x0B 0x6F 0x62 0x6A 0x65 0x63 0x74 0x43 0x6C 0x61 0x73 0x73 0x30 0x00 0x00 0x00 0x00 0x00 [07:55:42] DEBUG [org.apache.directory.shared.ldap.codec.TwixDecoder] - Decoded LdapMessage : LdapMessage message Id : 3 Search Request Base Object : 'ou=Search,o=IMC,c=US' Scope : base object Deref Aliases : deref Always Size Limit : no limit Time Limit : no limit Types Only : false Filter : '(objectClass=*)'
Emmanuel Lecharny made changes - 21/Feb/06 03:57 PM
Emmanuel Lecharny made changes - 22/Feb/06 08:02 AM
Ok, applied in trunks !
Emmanuel Lecharny made changes - 22/Feb/06 08:02 AM
Norval Hope made changes - 03/Dec/08 11:18 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append( " SearchRequest\n" );
sb.append( super.toString() );
sb.append( " baseDn : '" ).append(baseDn).append("'\n");
sb.append( " filter : '" );
filter.printToBuffer(sb);
sb.append("'\n");
sb.append( " scope : " ).append(scope.toString()).append('\n');
sb.append( " typesOnly : " ).append(typesOnly).append('\n');
sb.append( " sizeLimit : " ).append(sizeLimit).append('\n');
sb.append( " timeLimit : " ).append(timeLimit).append('\n');
sb.append( " derefAliases : " ).append(derefAliases).append('\n');
sb.append( " attributes : " );
boolean first = true;
for (Iterator it = attributes.iterator(); it.hasNext();)
{
final String s = (String)it.next();
if (!first)
sb.append(", ");
sb.append('\'').append(s).append('\'');
}
sb.append('\n');
return sb.toString();
}