From 8550f4da086fe77943124164c41c4210f348c940 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Wed, 18 Nov 2009 06:43:23 +0000 Subject: [PATCH] Removing ArrayUtils.hashCode per LANG-492; it is now available as java.util.Arrays.hashCode git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@881685 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/ArrayUtils.java | 12 ------------ .../org/apache/commons/lang/ArrayUtilsTest.java | 13 ------------- 2 files changed, 25 deletions(-) diff --git a/src/java/org/apache/commons/lang/ArrayUtils.java b/src/java/org/apache/commons/lang/ArrayUtils.java index 27ba595cc..ab536be38 100644 --- a/src/java/org/apache/commons/lang/ArrayUtils.java +++ b/src/java/org/apache/commons/lang/ArrayUtils.java @@ -180,18 +180,6 @@ public class ArrayUtils { return new ToStringBuilder(array, ToStringStyle.SIMPLE_STYLE).append(array).toString(); } - /** - *

Get a hashCode for an array handling multi-dimensional arrays correctly.

- * - *

Multi-dimensional primitive arrays are also handled correctly by this method.

- * - * @param array the array to get a hashCode for, may be null - * @return a hashCode for the array, zero if null array input - */ - public static int hashCode(Object array) { - return new HashCodeBuilder().append(array).toHashCode(); - } - /** *

Compares two arrays, using equals(), handling multi-dimensional arrays * correctly.

diff --git a/src/test/org/apache/commons/lang/ArrayUtilsTest.java b/src/test/org/apache/commons/lang/ArrayUtilsTest.java index 08fc6584f..1f12fea19 100644 --- a/src/test/org/apache/commons/lang/ArrayUtilsTest.java +++ b/src/test/org/apache/commons/lang/ArrayUtilsTest.java @@ -92,19 +92,6 @@ public class ArrayUtilsTest extends TestCase { assertEquals("{pink,blue}", ArrayUtils.toString(new String[] {"pink","blue"}, "")); } - //----------------------------------------------------------------------- - public void testHashCode() { - long[][] array1 = new long[][] {{2,5}, {4,5}}; - long[][] array2 = new long[][] {{2,5}, {4,6}}; - assertEquals(true, ArrayUtils.hashCode(array1) == ArrayUtils.hashCode(array1)); - assertEquals(false, ArrayUtils.hashCode(array1) == ArrayUtils.hashCode(array2)); - - Object[] array3 = new Object[] {new String(new char[] {'A', 'B'})}; - Object[] array4 = new Object[] {"AB"}; - assertEquals(true, ArrayUtils.hashCode(array3) == ArrayUtils.hashCode(array3)); - assertEquals(true, ArrayUtils.hashCode(array3) == ArrayUtils.hashCode(array4)); - } - //----------------------------------------------------------------------- private void assertIsEquals(Object array1, Object array2, Object array3) { assertEquals(true, ArrayUtils.isEquals(array1, array1));