Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 50165 invoked from network); 21 Aug 2002 20:38:23 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Aug 2002 20:38:23 -0000 Received: (qmail 18596 invoked by uid 97); 21 Aug 2002 20:38:47 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 18475 invoked by uid 97); 21 Aug 2002 20:38:46 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 18437 invoked by uid 98); 21 Aug 2002 20:38:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Wed, 21 Aug 2002 16:38:12 -0400 (EDT) From: Henri Yandell X-X-Sender: To: Jakarta Commons Developers List , Ola Berg Subject: Re: [commons]NPE or IAE? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I do recall this coming up in Collections and I think they chose to throw NPE if null was passed in and not IAE, I think because Sun stated that for Collections. A preferred style document sounds good to me. Possibly one project could adopt it, [Collections? Lang?] and others would choose to go with it or not. I would be tempted to think that Collections would be best placed for this and am +1 for Lang/Util/IO to adhere any coding standard which Collections choose. Hen On Wed, 21 Aug 2002, Ola Berg wrote: > A quickie. > > When contributing new code directly to Commons, would you like me to use IllegalArgumentException for all illegal arguments to a method, or NullPointerException for the illegal nulls? > > This question goes out to > 1) all Commons, since this is fresh code in Commons > 2) io, since the particular class is in io > 3) lang, since it works closely with lang > > Preferences, anybody? > > Personally, I prefer IAE, since that leaves me with only one exception to throw for all illegal arguments, regardless of cause. Putting the right value in a parameter is something you do in order to maintain consistency, avoiding NPE and other runtime exceptions. IMO. > > Second: there was a thread on coding conventions lately. I wonder if > it would be a benefit if questions like these (such as naming > conventions: XxxUtils/Xxxs, when to use toXxx and when to use asXxx > etc) could be answered in a \"prefered style\" document: a non binding > style guide that reflects the most popular styles of the committers, > or lists the acceptable styles (sorted in order of preference maybe)? > > IIRC, XxxUtils was favored over Xxxs by the majority, but was that documented (elsewhere than in the mails)? In a document where the answer to the NPE/IAE question should go too? > > /O > > -------------------- > ola.berg@arkitema.se > 0733 - 99 99 17 > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: