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 95C8BD543 for ; Thu, 28 Feb 2013 19:59:17 +0000 (UTC) Received: (qmail 58140 invoked by uid 500); 28 Feb 2013 19:59:16 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 57928 invoked by uid 500); 28 Feb 2013 19:59:16 -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 57741 invoked by uid 99); 28 Feb 2013 19:59:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 19:59:16 +0000 Date: Thu, 28 Feb 2013 19:59:16 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (COLLECTIONS-318) CollectionUtils.size(Object object) has impossible null check 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-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Neidhart resolved COLLECTIONS-318. ----------------------------------------- Resolution: Fixed > CollectionUtils.size(Object object) has impossible null check > ------------------------------------------------------------- > > Key: COLLECTIONS-318 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-318 > Project: Commons Collections > Issue Type: Bug > Components: Collection > Reporter: Sebb > Priority: Minor > Fix For: 4.0 > > > CollectionUtils.size(Object object) has impossible null check: > {code} > public static int size(Object object) { > if (object == null) { > return 0; > } > ... > } else if (object == null) { > throw new IllegalArgumentException("Unsupported object type: null"); > ... > {code} > The Javadoc specifically says that null is allowed, so I think the object == null clause needs to be removed - it can never be true, and is just confusing. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira