Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07A9D11607 for ; Wed, 2 Jul 2014 08:39:36 +0000 (UTC) Received: (qmail 95860 invoked by uid 500); 2 Jul 2014 08:39:35 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 95813 invoked by uid 500); 2 Jul 2014 08:39:35 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 95784 invoked by uid 99); 2 Jul 2014 08:39:35 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 08:39:35 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8D8CD992F1F; Wed, 2 Jul 2014 08:39:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org Date: Wed, 02 Jul 2014 08:39:35 -0000 Message-Id: <6e0321e8f23442848d3bf1a7ea466ed8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/7] git commit: Fix compilation with java 6 (JAVA-7147 regression) 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 Authored: Wed Jul 2 10:23:19 2014 +0200 Committer: Sylvain Lebresne 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());