You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2014/08/03 06:47:04 UTC

[2/4] git commit: simplify charset handling

simplify charset handling


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/57abab1f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/57abab1f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/57abab1f

Branch: refs/heads/trunk
Commit: 57abab1f2551fb5e3792bc9f3828af3c04d52636
Parents: cfb335e
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Sun Aug 3 00:25:14 2014 -0400
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Sun Aug 3 00:25:14 2014 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/thrift/CassandraServer.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/57abab1f/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index 86b5bee..4edb64d 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeoutException;
@@ -1875,7 +1876,7 @@ public class CassandraServer implements Cassandra.Iface
 
                     decompressor.end();
 
-                    queryString = new String(decompressed.getData(), 0, decompressed.getLength(), "UTF-8");
+                    queryString = new String(decompressed.getData(), 0, decompressed.getLength(), StandardCharsets.UTF_8);
                     break;
                 case NONE:
                     try
@@ -1893,10 +1894,6 @@ public class CassandraServer implements Cassandra.Iface
         {
             throw new InvalidRequestException("Error deflating query string.");
         }
-        catch (UnsupportedEncodingException e)
-        {
-            throw new InvalidRequestException("Unknown query string encoding.");
-        }
         return queryString;
     }