From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26861 invoked by alias); 27 Nov 2006 18:42:44 -0000 Received: (qmail 26853 invoked by uid 22791); 27 Nov 2006 18:42:44 -0000 X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 27 Nov 2006 18:42:39 +0000 Received: from dijkstra.wildebeest.org ([192.168.1.29]) by gnu.wildebeest.org with esmtp (Exim 3.36 #1 (Debian)) id 1GolRO-0008HA-00 for ; Mon, 27 Nov 2006 19:42:54 +0100 Subject: FYI null Vector vs removeAll(null) and retainAll(null) From: Mark Wielaard To: mauve-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-yQSU27D4y7HI3eZt4jH7" Date: Mon, 27 Nov 2006 18:42:00 -0000 Message-Id: <1164652954.30677.8.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00752.txt.bz2 --=-yQSU27D4y7HI3eZt4jH7 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 350 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 * 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 --=-yQSU27D4y7HI3eZt4jH7 Content-Disposition: inline; filename=AcuniaVectorTest-remove-retain-empty.diff Content-Type: text/x-patch; name=AcuniaVectorTest-remove-retain-empty.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1437 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"); --=-yQSU27D4y7HI3eZt4jH7--