directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r158973 - directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java
Date Fri, 25 Mar 2005 00:27:54 GMT
Author: akarasulu
Date: Thu Mar 24 16:27:53 2005
New Revision: 158973

URL: http://svn.apache.org/viewcvs?view=rev&rev=158973
Log:
found bug where we blow a ClassCastException while trying to fix another

Modified:
    directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java

Modified: directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java?view=diff&r1=158972&r2=158973
==============================================================================
--- directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java
(original)
+++ directory/shared/ldap/trunk/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/SnickersEncoder.java
Thu Mar 24 16:27:53 2005
@@ -164,7 +164,19 @@
          */
         public void encodeOccurred( StatefulEncoder encoder, Object encoded )
         {
-             accumulator.fill( ( ByteBuffer ) encoded );
+            if ( encoded instanceof ByteBuffer[] )
+            {
+                ByteBuffer[] buffers = ( ByteBuffer[] ) encoded;
+
+                for ( int ii = 0; ii < buffers.length; ii++ )
+                {
+                    accumulator.fill( buffers[ii] );
+                }
+
+                return;
+            }
+
+            accumulator.fill( ( ByteBuffer ) encoded );
         }
 
 



Mime
View raw message