directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r344353 - /directory/network/branches/0.8/src/java/org/apache/mina/common/ByteBuffer.java
Date Tue, 15 Nov 2005 12:02:58 GMT
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()
);



Mime
View raw message