commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r899940 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java
Date Sat, 16 Jan 2010 13:05:07 GMT
Author: sebb
Date: Sat Jan 16 13:05:07 2010
New Revision: 899940

URL: http://svn.apache.org/viewvc?rev=899940&view=rev
Log:
LANG-571 ArrayUtils.add(T[] array[, offset], T element) can create unexpected ClassCastException
Remove tests for generation of Object arrays when both objects are null

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java?rev=899940&r1=899939&r2=899940&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java
Sat Jan 16 13:05:07 2010
@@ -178,15 +178,8 @@
 
     public void testAddObjectArrayObject() {
         Object[] newArray;
-        newArray = ArrayUtils.add((Object[])null, null);
-        assertTrue(Arrays.equals((new Object[]{null}), newArray));
-        assertEquals(Object.class, newArray.getClass().getComponentType());
 
         //show that not casting is okay
-        newArray = ArrayUtils.add(null, null);
-        assertTrue(Arrays.equals((new Object[]{null}), newArray));
-        assertEquals(Object.class, newArray.getClass().getComponentType());
-
         newArray = ArrayUtils.add((Object[])null, "a");
         assertTrue(Arrays.equals((new String[]{"a"}), newArray));
         assertTrue(Arrays.equals((new Object[]{"a"}), newArray));
@@ -216,10 +209,6 @@
         newArray = ArrayUtils.add(numberArray1, new Float(3));
         assertTrue(Arrays.equals((new Float[]{new Float(3)}), newArray));
         assertEquals(Float.class, newArray.getClass().getComponentType());
-
-        newArray = ArrayUtils.add(numberArray1, null);
-        assertTrue(Arrays.equals((new Object[]{null}), newArray));
-        assertEquals(Object.class, newArray.getClass().getComponentType());
     }
     
     public void testLANG571(){
@@ -360,9 +349,6 @@
 
     public void testAddObjectAtIndex() {
         Object[] newArray;
-        newArray = ArrayUtils.add((Object[])null, 0, null);
-        assertTrue(Arrays.equals((new Object[]{null}), newArray));
-        assertEquals(Object.class, newArray.getClass().getComponentType());
         newArray = ArrayUtils.add((Object[])null, 0, "a");
         assertTrue(Arrays.equals((new String[]{"a"}), newArray));
         assertTrue(Arrays.equals((new Object[]{"a"}), newArray));



Mime
View raw message