directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r344354 - /directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java
Date Tue, 15 Nov 2005 12:03:11 GMT
Author: trustin
Date: Tue Nov 15 04:03:07 2005
New Revision: 344354

URL: http://svn.apache.org/viewcvs?rev=344354&view=rev
Log:
Resolved issue: DIRMINA-124 - ByteBuffer.getString(...) throws an IllegalStateException
* Added more if block to filter empty strings

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java?rev=344354&r1=344353&r2=344354&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/ByteBuffer.java Tue Nov 15 04:03:07
2005
@@ -1086,6 +1086,10 @@
             }
 
             buf.position( oldPos );
+            if( !buf.hasRemaining() )
+            {
+                return "";
+            }
             decoder.reset();
 
             int expectedLength = (int) ( buf.remaining() * decoder.averageCharsPerByte()
);
@@ -1195,6 +1199,10 @@
             }
 
             buf.position( oldPos );
+            if( !buf.hasRemaining() )
+            {
+                return "";
+            }
             decoder.reset();
 
             int expectedLength = (int) ( buf.remaining() * decoder.averageCharsPerByte()
);



Mime
View raw message