cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [2/3] git commit: simplify charset handling
Date Sun, 03 Aug 2014 04:45:21 GMT
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/cassandra-2.1
Commit: 57abab1f2551fb5e3792bc9f3828af3c04d52636
Parents: cfb335e
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sun Aug 3 00:25:14 2014 -0400
Committer: Dave Brosius <dbrosius@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;
     }
 


Mime
View raw message