public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: mauve-patches@sources.redhat.com
Subject: FYI null Vector vs removeAll(null) and retainAll(null)
Date: Mon, 27 Nov 2006 18:42:00 -0000	[thread overview]
Message-ID: <1164652954.30677.8.camel@dijkstra.wildebeest.org> (raw)

[-- 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");

                 reply	other threads:[~2006-11-27 18:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1164652954.30677.8.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=mauve-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).