cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r959669 - /cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
Date Thu, 01 Jul 2010 14:01:07 GMT
Author: jbellis
Date: Thu Jul  1 14:01:07 2010
New Revision: 959669

URL: http://svn.apache.org/viewvc?rev=959669&view=rev
Log:
CharsetDecoder is stateful; use local instances.  patch by jbellis for CASSANDRA-1232

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java?rev=959669&r1=959668&r2=959669&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
Thu Jul  1 14:01:07 2010
@@ -29,14 +29,11 @@ import java.util.Arrays;
 
 public class UTF8Type extends BytesType
 {
-    private static final CharsetDecoder utf8Decoder;
-    static
-    {
-        utf8Decoder = Charset.forName("UTF-8").newDecoder();
-    }
+    private static final Charset UTF_8 = Charset.forName("UTF-8");
 
     public String getString(byte[] bytes)
     {
+        CharsetDecoder utf8Decoder = UTF_8.newDecoder();
         try
         {
             return utf8Decoder.decode(ByteBuffer.wrap(bytes)).toString();



Mime
View raw message