cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: simplify: no need for 'Unsupported' exception handling with UTF-8
Date Tue, 05 Jan 2016 03:13:46 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 1bc147cea -> 5fe709706


simplify: no need for 'Unsupported' exception handling with UTF-8


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

Branch: refs/heads/trunk
Commit: 5fe7097068ae5cb1272b28c2bfe0ef3f48e2ba61
Parents: 1bc147c
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Mon Jan 4 22:13:06 2016 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Mon Jan 4 22:13:06 2016 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/utils/MD5Digest.java | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5fe70970/src/java/org/apache/cassandra/utils/MD5Digest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/MD5Digest.java b/src/java/org/apache/cassandra/utils/MD5Digest.java
index 2dc57de..2feb09e 100644
--- a/src/java/org/apache/cassandra/utils/MD5Digest.java
+++ b/src/java/org/apache/cassandra/utils/MD5Digest.java
@@ -17,9 +17,10 @@
  */
 package org.apache.cassandra.utils;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 
+
 /**
  * The result of the computation of an MD5 digest.
  *
@@ -51,14 +52,7 @@ public class MD5Digest
 
     public static MD5Digest compute(String toHash)
     {
-        try
-        {
-            return compute(toHash.getBytes("UTF-8"));
-        }
-        catch (UnsupportedEncodingException e)
-        {
-            throw new RuntimeException(e.getMessage());
-        }
+        return compute(toHash.getBytes(StandardCharsets.UTF_8));
     }
 
     @Override


Mime
View raw message