Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CCFDD44B for ; Thu, 30 Aug 2012 01:33:42 +0000 (UTC) Received: (qmail 52695 invoked by uid 500); 30 Aug 2012 01:33:41 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 52606 invoked by uid 500); 30 Aug 2012 01:33:41 -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 52598 invoked by uid 99); 30 Aug 2012 01:33:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2012 01:33:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of phil.steitz@gmail.com designates 209.85.210.43 as permitted sender) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2012 01:33:32 +0000 Received: by daku36 with SMTP id u36so952454dak.30 for ; Wed, 29 Aug 2012 18:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=n7N8I0tj4gUpYzuFHbF77HI/JJvmDY72La1XQLvCqfw=; b=pEmg1SBDtnhtk771N0c/AB8bEfpxJE8SJNTDGu8l5yYRbvO5VP9Sf4mH3CIbqAxxtq a2JXVN1SzU/ndaw/g/Y/rAnu97nrGmYo/UXfLBwkT23NDGF/EK5FEgchEYsS4564GnmY WYtlJbcNB9Uyp+beUep/XaJf3xTQDUorn8Hi7RvsG61Bfx+6Wale9nSNDyXEkOE6MZTN tWeArn148QiVQ8h1mn9SkuoD/46A7iXC7mCHE2v66X3IweXQA339as/QMvSi7a2c/Zkm 5XdW5Agk5U7je/qxWLJj7LDN6+sTyf3beWaRX0lNnr9krz5fTVxkU3+8p1uiHR3OghuW A6vA== Received: by 10.68.201.73 with SMTP id jy9mr8389735pbc.124.1346290391159; Wed, 29 Aug 2012 18:33:11 -0700 (PDT) Received: from [192.168.71.100] ([207.239.114.206]) by mx.google.com with ESMTPS id ud8sm450683pbc.35.2012.08.29.18.33.09 (version=SSLv3 cipher=OTHER); Wed, 29 Aug 2012 18:33:10 -0700 (PDT) Message-ID: <503EC2D1.5010604@gmail.com> Date: Wed, 29 Aug 2012 18:33:05 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] Re: Single root for Exceptions References: <50367DE8.20909@gmail.com> <20120823233544.GS24856@dusk.harfang.homelinux.org> <50372DDD.2050003@free.fr> <20120825214353.GU24856@dusk.harfang.homelinux.org> <5039CE39.2030705@free.fr> <503A5FF8.1030408@gmail.com> <503CBB41.7050005@free.fr> <503D2C04.40507@gmail.com> <20120828234049.GC24856@dusk.harfang.homelinux.org> <503DCC91.8010103@free.fr> <20120829220454.GG24856@dusk.harfang.homelinux.org> In-Reply-To: <20120829220454.GG24856@dusk.harfang.homelinux.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 8/29/12 3:04 PM, Gilles Sadowski wrote: > Hello. > > To summarize: > (1) Does anyone disagree with having all CM exceptions inherit > from a new "MathRuntimeException" which itself will inherit > from the standard "RuntimeException"? +0 > (2) Does anyone disagree with all exceptions being mandatorily > advertized in the "throws" clause of methods and constructors? > That means that for each exception explicitly instantiated in the > body of the method, the instantiated type must appear in "throws" > clause. +1 - though I am OK advertising superclasses in cases where that is appropriate (but not to the point of (3) below) > (3) Does anyone disagree that the "throws" clause of a method could > advertize "MathRuntimeException" for any exception not thrown by > itself but by a method which it calls? > That means that it is not mandatory to indicate the specific type > for exceptions not explicitly instantiated in the body the current > method. -1 In general, we should avoid that, because it is equivalent to "throws Exception." The exceptions that a method in the public [math] API propagates should be documented and advertised by it. Which exceptions a method itself generates is an implementation artifact. What is important in the API is what exceptions the caller is going to see. Phil > > > I'm not sure about point (3); it seems that it would avoid duplicating > descriptions of lower-level preconditions for CM methods that calls other CM > methods or advertizing something that would be an implementation detail for > the calling method. I didn't check how often that would apply... > At first sight, that would surely avoid that upper levels are tightly > coupled to lower levels: if a method is modified to throw a new exception, > methods that call it do not have to update their documentation and "throws" > clause. > > > Regards, > 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