directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r280690 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java
Date Tue, 13 Sep 2005 22:16:48 GMT
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" );
                         }



Mime
View raw message