Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 46155 invoked from network); 17 Mar 2006 09:12:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Mar 2006 09:12:07 -0000 Received: (qmail 64640 invoked by uid 500); 17 Mar 2006 09:11:53 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 64586 invoked by uid 500); 17 Mar 2006 09:11:53 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 64575 invoked by uid 99); 17 Mar 2006 09:11:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2006 01:11:52 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mloenko@gmail.com designates 66.249.92.205 as permitted sender) Received: from [66.249.92.205] (HELO uproxy.gmail.com) (66.249.92.205) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2006 01:11:52 -0800 Received: by uproxy.gmail.com with SMTP id c2so301122ugf for ; Fri, 17 Mar 2006 01:11:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nsJjx4D8ZpTzBzjsfjC1ITqsxOjRXJoDtjiUMwf2YF+cQaOFxiT792Vmv+v++XkR/3iNjEXMxB+uzRhYzyhd317YfEAqo876e66P0D953gujedygupLwJGc0PHzVnrBbmyIkbAteBH/njIERA4nOChX2ZWbjUWudRX+lcXPa5yo= Received: by 10.66.224.14 with SMTP id w14mr1722976ugg; Fri, 17 Mar 2006 01:11:30 -0800 (PST) Received: by 10.66.244.19 with HTTP; Fri, 17 Mar 2006 01:11:30 -0800 (PST) Message-ID: <906dd82e0603170111l3c8fd3dep@mail.gmail.com> Date: Fri, 17 Mar 2006 15:11:30 +0600 From: "Mikhail Loenko" To: harmony-dev@incubator.apache.org Subject: Re: NullPointerException In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Karan, Actually there is a number of conditions that affect final case-by-case mad= e decision: 1. The spec might say a) that SomeException (SE) is thrown in case of null arg b) that SE is thrown in case of "invalid" arg c) nothing about wrong args 2. The class and method under consideration might pass argument and control to some user's or third-party class (like some handler or crypto algorithm)= and RI's NPE happens originally there. In this case we should study the spec for that class, implications of null arguments in that class and case-by-case decide= . I think being compatible with RI is by-default decision, and in the majority of cases is the right decision to take. BTW, explicit check of an arg for null would unnoticably slow down executio= n in case of non-null argument but would siginificantly speed it up in case of null. Once again, decision is to be made case-by-case Thanks, Mikhail