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 2005/09/14 00:16:48 UTC

svn commit: r280690 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java

Author: elecharny
Date: Tue Sep 13 15:16:42 2005
New Revision: 280690

URL: http://svn.apache.org/viewcvs?rev=280690&view=rev
Log:
Fixed a bug in toString method : if the Value was a String, and not an OctetString, we obtained a ClassCast exception

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java?rev=280690&r1=280689&r2=280690&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java (original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java Tue Sep 13 15:16:42 2005
@@ -456,7 +456,18 @@
                         	Object value = values.nextElement();
                         	sb.append( "                '" );
                         	
-                       		sb.append( StringUtils.dumpBytes( ( (OctetString)value ).getValue() ) );
+                            if (value instanceof String)
+                            {
+                                sb.append( (String)value );
+                            }
+                            else if (value instanceof OctetString)
+                            {
+                                sb.append( StringUtils.dumpBytes( ( (OctetString)value ).getValue() ) );
+                            }
+                            else
+                            {
+                                sb.append( StringUtils.dumpBytes( (byte[])value ) );
+                            }
 
                             sb.append("'\n" );
                         }