Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 91658 invoked from network); 1 Feb 2011 12:36:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 12:36:49 -0000 Received: (qmail 38874 invoked by uid 500); 1 Feb 2011 12:36:49 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 38303 invoked by uid 500); 1 Feb 2011 12:36:46 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 38295 invoked by uid 99); 1 Feb 2011 12:36:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 12:36:46 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.216.178 as permitted sender) Received: from [209.85.216.178] (HELO mail-qy0-f178.google.com) (209.85.216.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 12:36:39 +0000 Received: by qyk33 with SMTP id 33so6541863qyk.9 for ; Tue, 01 Feb 2011 04:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=zKVuE+fQto2oS21x8CJ+O0dWERPPorCJX3Avh/UpqlI=; b=D5RIZdVT62xcB6gTOx3wFUreRN6AESR/gKG+eKGM1Tn4SkjqQzxgz9oi534qbqkBVD lXxSbScqDb4xrYq4tHdst8OidQdPGpFzodzgDGsJQ93gf+5BsJR2O72t6r3xCvq4Vqu8 Wwi1sUE49DPaouayEy6VLjXQEBwTDwbBcpOlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=U2ub4Hu/ww8FX4XAvWqAnRozl/er1Iw/pyG2PtuukUbUiOp/G09WhT0mmiZWRGz5V9 p6MXIx2u+eRY0rwTsnkugQcpLmYyponhCZ79SpHVlG7f2UkSX6f2K5xGr+wfoZwwbdGN 7U6HbC7NlWruSAdLLf0LhZNtITgSY2FSNiYiM= MIME-Version: 1.0 Received: by 10.224.28.75 with SMTP id l11mr7557134qac.381.1296563777430; Tue, 01 Feb 2011 04:36:17 -0800 (PST) Received: by 10.220.62.7 with HTTP; Tue, 1 Feb 2011 04:36:17 -0800 (PST) In-Reply-To: <20110201112031.GV22814@dusk.harfang.homelinux.org> References: <20110201002348.DE6CE23889DA@eris.apache.org> <20110201112031.GV22814@dusk.harfang.homelinux.org> Date: Tue, 1 Feb 2011 12:36:17 +0000 Message-ID: Subject: Re: svn commit: r1065874 - /commons/proper/math/trunk/src/site/xdoc/developers.xml From: sebb To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 1 February 2011 11:20, Gilles Sadowski wr= ote: > Hi. > >> Added section on Exceptions. > > I agree with the explanations; however I think that we should add a parag= raph > (see below). > >> Modified: >> =A0 =A0 commons/proper/math/trunk/src/site/xdoc/developers.xml >> >> Modified: commons/proper/math/trunk/src/site/xdoc/developers.xml >> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdo= c/developers.xml?rev=3D1065874&r1=3D1065873&r2=3D1065874&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- commons/proper/math/trunk/src/site/xdoc/developers.xml (original) >> +++ commons/proper/math/trunk/src/site/xdoc/developers.xml Tue Feb =A01 = 00:23:48 2011 >> @@ -183,6 +183,50 @@ >> =A0 =A0 =A0 =A0Guide. >> =A0 =A0 =A0 >> =A0 =A0 >> + =A0 >> + =A0 =A0
    >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0Exceptions generated by Commons Math are all unchecked. >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0All public methods advertise all exceptions that they can g= enerate. >> + =A0 =A0 =A0Exceptions must be documented in both javadoc and me= thod signatures >> + =A0 =A0 =A0and the documentation in the javadoc must include fu= ll description >> + =A0 =A0 =A0of the conditions under which exceptions are thrown.
  • >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0All exceptions inherit from the base class, MathRuntimeExce= ption.
  • >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0Methods should fully specify parameter preconditions= required for >> + =A0 =A0 =A0successful activation. =A0When preconditions are violated, = a >> + =A0 =A0 =A0MathIllegalArgumentException should be thrown. =A0Subclasse= s of >> + =A0 =A0 =A0MathIllegalArgumentException may be used to represent commo= n parameter >> + =A0 =A0 =A0contract violations (for example, NoBracketingException). = =A0Exception >> + =A0 =A0 =A0messages must contain sufficient information on para= meter values to >> + =A0 =A0 =A0determine the exact precondition failure.
  • >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0Exceptions generated by Commons Math make sense without kno= wing >> + =A0 =A0 =A0implementation details other than those stated in the publi= c API. >> + =A0 =A0 =A0For example, a NoBracketingException makes sense thrown by = a solver that >> + =A0 =A0 =A0has a precondition requiring that initial points bracket a = root. This >> + =A0 =A0 =A0exception does not make sense, however, thrown by an invers= e cumulative >> + =A0 =A0 =A0probability estimator.
  • >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0MathIllegalArgumentException should only be thrown in situa= tions >> + =A0 =A0 =A0where preconditions can be exhaustively provided so that wh= at arguments >> + =A0 =A0 =A0are "illegal" can be specified fully to the caller. Domain-= specific >> + =A0 =A0 =A0exceptions need to be defined for cases where failures cann= ot be >> + =A0 =A0 =A0attributed to parameter precondition violation. For example= , the exact >> + =A0 =A0 =A0domain of successful activation of a solver or quadrature m= ethod may be >> + =A0 =A0 =A0impossible to specify because of numerical properties of th= e method. >> + =A0 =A0 =A0If a solver fails to find a root or a quadrature method fai= ls to converge >> + =A0 =A0 =A0for a given set of parameters, unless those parameters v= iolate the >> + =A0 =A0 =A0advertised preconditions it is not appropriate to throw >> + =A0 =A0 =A0MathIllegalArgumentException.
  • > > =A0If the failure results from an exception thrown by user code (e.g. an > =A0exception is thrown while a solver is evaluating a user-defined functi= on), > =A0the Commons Math code must let it propagate without interference. That may not be possible in general. If the user code generates an Exception that CM already handles, how can CM distinguish this case? >> + =A0 =A0 =A0
  • >> + =A0 =A0 =A0State information included in exception messages must be available >> + =A0 =A0 =A0in exception properties - i.e., successful handling or repo= rting of >> + =A0 =A0 =A0Commons Math exceptions must not require parsing exception = messages.
  • >> + =A0 =A0
>> + =A0
> > > Gilles > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org