From 2af8591bd71838b9782c552c6724f1efe1cc836e Mon Sep 17 00:00:00 2001 From: Eric Evans Date: Fri, 27 Apr 2012 09:40:56 -0500 Subject: [PATCH] eliminate clientutil dependency on commons-lang Patch by Dave Brosius; reviewed by eevans for CASSANDRA-3665 --- build.xml | 1 - .../org/apache/cassandra/utils/ByteBufferUtil.java | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.xml b/build.xml index b7df8d2659..1ef21f0730 100644 --- a/build.xml +++ b/build.xml @@ -1077,7 +1077,6 @@ - diff --git a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java index 93f28df9fd..e35e137b5b 100644 --- a/src/java/org/apache/cassandra/utils/ByteBufferUtil.java +++ b/src/java/org/apache/cassandra/utils/ByteBufferUtil.java @@ -18,6 +18,12 @@ */ package org.apache.cassandra.utils; +/* + * BE ADVISED: New imports added here might introduce new dependencies for + * the clientutil jar. If in doubt, run the `ant test-clientutil-jar' target + * afterward, and ensure the tests still pass. + */ + import java.io.*; import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; @@ -29,8 +35,6 @@ import static com.google.common.base.Charsets.UTF_8; import org.apache.cassandra.io.util.FileDataInput; import org.apache.cassandra.io.util.FileUtils; -import org.apache.commons.lang.ArrayUtils; - /** * Utility methods to make ByteBuffers less painful * The following should illustrate the different ways byte buffers can be used @@ -71,7 +75,7 @@ import org.apache.commons.lang.ArrayUtils; */ public class ByteBufferUtil { - public static final ByteBuffer EMPTY_BYTE_BUFFER = ByteBuffer.wrap(ArrayUtils.EMPTY_BYTE_ARRAY); + public static final ByteBuffer EMPTY_BYTE_BUFFER = ByteBuffer.wrap(new byte[0]); public static int compareUnsigned(ByteBuffer o1, ByteBuffer o2) {