This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI null Vector vs removeAll(null) and retainAll(null)
- From: Mark Wielaard <mark at klomp dot org>
- To: mauve-patches at sources dot redhat dot com
- Date: Mon, 27 Nov 2006 19:42:34 +0100
- Subject: FYI null Vector vs removeAll(null) and retainAll(null)
Hi,
As discussed on the classpath mailinglist these two checks seem a little
too pedantic. So I have disabled them.
2006-11-27 Mark Wielaard <mark@klomp.org>
* gnu/testlet/java/util/Vector/AcuniaVectorTest.java: Don't demand
a NullPointerException when doing a removeAll(null) or a
retainAll(null) on an empty Vector.
Cheers,
Mark
Index: gnu/testlet/java/util/Vector/AcuniaVectorTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/util/Vector/AcuniaVectorTest.java,v
retrieving revision 1.5
diff -u -r1.5 AcuniaVectorTest.java
--- gnu/testlet/java/util/Vector/AcuniaVectorTest.java 21 Feb 2005 15:52:53 -0000 1.5
+++ gnu/testlet/java/util/Vector/AcuniaVectorTest.java 27 Nov 2006 18:39:50 -0000
@@ -688,10 +688,15 @@
public void test_removeAll() throws UnsupportedOperationException{
th.checkPoint("removeAll(java.util.Collection)boolean");
Vector v = new Vector();
+
+ /**
+ * Disabled. A little too strict.
+ We will allow removing null from an empty Vector.
try { v.removeAll(null);
th.fail("should throw NullPointerException");
}
catch (NullPointerException ne) { th.check(true); }
+ */
v.add("a");
try { v.removeAll(null);
@@ -935,10 +940,14 @@
public void test_retainAll(){
th.checkPoint("retainAll(java.util.Collection)boolean");
Vector v = new Vector();
+ /**
+ * Disabled. A little too strict.
+ We will allow retaining null from an empty Vector.
try { v.retainAll(null);
th.fail("should throw NullPointerException");
}
catch (NullPointerException ne) { th.check(true); }
+ */
v.add("a");
try { v.retainAll(null);
th.fail("should throw NullPointerException");