You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/11/15 13:02:58 UTC

svn commit: r344353 - /directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java

Author: trustin
Date: Tue Nov 15 04:02:51 2005
New Revision: 344353

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

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

Modified: directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java?rev=344353&r1=344352&r2=344353&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java (original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java Tue Nov 15 04:02:51 2005
@@ -1084,6 +1084,10 @@
             }
 
             buf.position( oldPos );
+            if( !buf.hasRemaining() )
+            {
+                return "";
+            }
             decoder.reset();
 
             int expectedLength = (int) ( buf.remaining() * decoder.averageCharsPerByte() );
@@ -1193,6 +1197,10 @@
             }
 
             buf.position( oldPos );
+            if( !buf.hasRemaining() )
+            {
+                return "";
+            }
             decoder.reset();
 
             int expectedLength = (int) ( buf.remaining() * decoder.averageCharsPerByte() );