Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 33202 invoked from network); 5 Oct 2005 00:15:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Oct 2005 00:15:07 -0000 Received: (qmail 80770 invoked by uid 500); 5 Oct 2005 00:15:06 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 80211 invoked by uid 500); 5 Oct 2005 00:15:04 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 80200 invoked by uid 99); 5 Oct 2005 00:15:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2005 17:15:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.68.127.190] (HELO carmanconsulting.com) (216.68.127.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2005 17:15:08 -0700 Received: from CARMANI9300 (carmanconsulting.com [127.0.0.1]) by carmanconsulting.com (8.13.4/8.13.4) with ESMTP id j950Ea1s030587 for ; Tue, 4 Oct 2005 20:14:41 -0400 From: "James Carman" To: "'Jakarta Commons Developers List'" Subject: RE: [lang] ArrayUtils.toPrimitive and NPEs. Date: Tue, 4 Oct 2005 20:14:36 -0400 Message-ID: <000301c5c941$c58d34b0$6401a8c0@CARMANI9300> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <19B78354A4AA3E4287384F3D30933F88054773@MAIL1.seagull.nl> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Thread-Index: AcXJKba5jgDCT8V1Q2KJxV9xEYjT6QAAuRcgAAUmW7A= X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Actually, if you read the javadocs for NullPointerException, it says that "Applications should throw instances of this class to indicate other illegal uses of the null object." However, I agree with you. I like IllegalArgumentException or its NullArgumentException subclass (which I was unaware of until just the other day) for these types of situations. NullArgumentException should probably be moved to the exception package, by the way (that's where I first looked for it). -----Original Message----- From: Gary Gregory [mailto:ggregory@seagullsoftware.com] Sent: Tuesday, October 04, 2005 5:45 PM To: Jakarta Commons Developers List Subject: RE: [lang] ArrayUtils.toPrimitive and NPEs. > I think that the basic reasoning is/was to have a validating version and > a non-validating version of the same method. Perhaps, but if the intention was to say that nulls are illegal, letting NPE be thrown seem like a poor design decision to me as opposed to explicitly stating this intent with an IllegalArgumentException. Gary > -----Original Message----- > From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] > Sent: Tuesday, October 04, 2005 2:22 PM > To: Jakarta Commons Developers List > Subject: Re: [lang] ArrayUtils.toPrimitive and NPEs. > > Gary Gregory wrote: > > Hello: > > > > WRT: http://issues.apache.org/bugzilla/show_bug.cgi?id=36915 > > > > All of the ArrayUtils.toPrimitive one arg methods all NPE when an input > > element is null. Why would you want that? > > > > We have a handy two arg version of the methods that allows a default > > value to be passed in. Since primitives *have* default values, why not > > simply allow nulls not to NPE and take on the default primitive value? > > Seems easy enough to change... > > But it would have compatability issues. At the very least its a semantic > change. > > I think that the basic reasoning is/was to have a validating version and > a non-validating version of the same method. > > So I guess I'm -0. > > Stephen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org