cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/7] git commit: Fix compilation with java 6 (JAVA-7147 regression)
Date Wed, 02 Jul 2014 08:39:35 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 7045ff4b0 -> f781f46e9


Fix compilation with java 6 (JAVA-7147 regression)


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

Branch: refs/heads/trunk
Commit: 135513cf9b95edadf7ab52be8b05c2d83019f3cd
Parents: 73e1eff
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Jul 2 10:23:19 2014 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Jul 2 10:23:19 2014 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 3 +--
 src/java/org/apache/cassandra/utils/ByteBufferUtil.java     | 7 +++----
 src/java/org/apache/cassandra/utils/FBUtilities.java        | 3 +++
 3 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/135513cf/src/java/org/apache/cassandra/locator/CloudstackSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java
index 57c973b..eb671d7 100644
--- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java
+++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java
@@ -27,7 +27,6 @@ import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.URL;
 import java.net.URI;
-import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
@@ -137,7 +136,7 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch
             byte[] b = new byte[cl];
             is = new DataInputStream(new BufferedInputStream(conn.getInputStream()));
             is.readFully(b);
-            return new String(b, StandardCharsets.UTF_8);
+            return new String(b, FBUtilities.UTF_8);
         } 
         finally 
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/135513cf/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
index 86f3f02..acc4885 100644
--- a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
+++ b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
@@ -74,7 +74,6 @@ import org.apache.cassandra.io.util.FileUtils;
  */
 public class ByteBufferUtil
 {
-    private static final Charset UTF_8 = Charset.forName("UTF-8");
     public static final ByteBuffer EMPTY_BYTE_BUFFER = ByteBuffer.wrap(new byte[0]);
 
     public static int compareUnsigned(ByteBuffer o1, ByteBuffer o2)
@@ -121,7 +120,7 @@ public class ByteBufferUtil
      */
     public static String string(ByteBuffer buffer) throws CharacterCodingException
     {
-        return string(buffer, UTF_8);
+        return string(buffer, FBUtilities.UTF_8);
     }
 
     /**
@@ -135,7 +134,7 @@ public class ByteBufferUtil
      */
     public static String string(ByteBuffer buffer, int position, int length) throws CharacterCodingException
     {
-        return string(buffer, position, length, UTF_8);
+        return string(buffer, position, length, FBUtilities.UTF_8);
     }
 
     /**
@@ -228,7 +227,7 @@ public class ByteBufferUtil
      */
     public static ByteBuffer bytes(String s)
     {
-        return ByteBuffer.wrap(s.getBytes(UTF_8));
+        return ByteBuffer.wrap(s.getBytes(FBUtilities.UTF_8));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/135513cf/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java b/src/java/org/apache/cassandra/utils/FBUtilities.java
index 8cb6dae..437b6a8 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -27,6 +27,7 @@ import java.net.SocketException;
 import java.net.URL;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.*;
@@ -63,6 +64,8 @@ import org.codehaus.jackson.map.ObjectMapper;
 
 public class FBUtilities
 {
+    public static final Charset UTF_8 = Charset.forName("UTF-8");
+
     private static final Logger logger = LoggerFactory.getLogger(FBUtilities.class);
 
     private static ObjectMapper jsonMapper = new ObjectMapper(new JsonFactory());


Mime
View raw message