cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r1028485 - /cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
Date Thu, 28 Oct 2010 21:22:40 GMT
Author: gdusbabek
Date: Thu Oct 28 21:22:40 2010
New Revision: 1028485

URL: http://svn.apache.org/viewvc?rev=1028485&view=rev
Log:
FBU.decodeToUtf8 duplicates the BB so other threads can trust its position. patch by gdusbabek,
reviewed by jbellis. CASSANDRA-1645

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=1028485&r1=1028484&r2=1028485&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Thu Oct 28 21:22:40
2010
@@ -489,9 +489,8 @@ public class FBUtilities
 
     public static String decodeToUTF8(ByteBuffer bytes) throws CharacterCodingException
     {
-        bytes.mark();
+        bytes = bytes.duplicate();
         String decoded  =  Charsets.UTF_8.newDecoder().decode(bytes).toString();
-        bytes.reset();
         return decoded;
     }
 



Mime
View raw message