Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C8D59B08 for ; Thu, 26 Jul 2012 21:03:35 +0000 (UTC) Received: (qmail 83627 invoked by uid 500); 26 Jul 2012 21:03:35 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 83425 invoked by uid 500); 26 Jul 2012 21:03:35 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 83394 invoked by uid 99); 26 Jul 2012 21:03:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 21:03:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id DE0A1142838 for ; Thu, 26 Jul 2012 21:03:34 +0000 (UTC) Date: Thu, 26 Jul 2012 21:03:34 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: <180084672.108094.1343336614911.JavaMail.jiratomcat@issues-vm> In-Reply-To: <996324510.36388.1333076664475.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (COLLECTIONS-401) Inconsistent Javadoc comment and code in removeAll(Collection, Collection) in org.apache.commons.collections.ListUtils MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COLLECTIONS-401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Neidhart resolved COLLECTIONS-401. ----------------------------------------- Resolution: Not A Problem > Inconsistent Javadoc comment and code in removeAll(Collection, Collection) in org.apache.commons.collections.ListUtils > ---------------------------------------------------------------------------------------------------------------------------- > > Key: COLLECTIONS-401 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-401 > Project: Commons Collections > Issue Type: Bug > Components: Collection > Affects Versions: 3.2.1 > Reporter: SHIN HWEI TAN > Labels: javadoc > Original Estimate: 0.05h > Remaining Estimate: 0.05h > > The Javadoc comment below states that the method "throws NullPointerException if either parameter is null". > /*...... > * > * @throws NullPointerException if either parameter is null > */ > public static List removeAll(Collection collection, Collection remove) { > .. > } > However, when called with two null collections (i.e., "removeAll((Collection)null, (Collection)null)"), the method executes normally without throwing any exception. > Suggested Fixes: > 1. Add code "if (collection == null) throw NullPointerException();" at the beginning of the method body. > or > 2. Remove "@throws NullPointerException if either parameter is null" from the Javadoc. > or > 3. Change "@throws NullPointerException if either parameter is null" to "@throws NullPointerException if the first collection is null or (the first collection is non-empty and the second collection is null)". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira