* FYI null Vector vs removeAll(null) and retainAll(null)
@ 2006-11-27 18:42 Mark Wielaard
0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2006-11-27 18:42 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
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
[-- Attachment #2: AcuniaVectorTest-remove-retain-empty.diff --]
[-- Type: text/x-patch, Size: 1437 bytes --]
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");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-27 18:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27 18:42 FYI null Vector vs removeAll(null) and retainAll(null) Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).