Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 10572 invoked from network); 25 Dec 2006 10:33:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Dec 2006 10:33:59 -0000 Received: (qmail 60802 invoked by uid 500); 25 Dec 2006 10:34:04 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 60766 invoked by uid 500); 25 Dec 2006 10:34:04 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 60757 invoked by uid 99); 25 Dec 2006 10:34:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Dec 2006 02:34:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of alexey.a.petrenko@gmail.com designates 66.249.92.172 as permitted sender) Received: from [66.249.92.172] (HELO ug-out-1314.google.com) (66.249.92.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Dec 2006 02:33:54 -0800 Received: by ug-out-1314.google.com with SMTP id z36so2839869uge for ; Mon, 25 Dec 2006 02:33:33 -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=nBzwCT8OrODPTLjAC8kxEqc2MupF1x7nph3x3mY+HXgMWXSqrt6+5bf1ZADj1FauR1C2VKuE92ILznP/Cw1lBlg/fSDTNnnLr8wQl5WQgvjTuSPVERPykvXi3ccbaF57FCjQi4Np8kwd9E2vpMoNodRlC1cvZu5LvnaRL/baRHc= Received: by 10.78.178.5 with SMTP id a5mr2696681huf.1167042813439; Mon, 25 Dec 2006 02:33:33 -0800 (PST) Received: by 10.78.107.15 with HTTP; Mon, 25 Dec 2006 02:33:33 -0800 (PST) Message-ID: Date: Mon, 25 Dec 2006 13:33:33 +0300 From: "Alexey Petrenko" To: dev@harmony.apache.org Subject: Re: [general]what do you think about this kind of exception order? In-Reply-To: <211709bc0612222103m6eb0bd9bmf8b50c23281786e0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <211709bc0612220852i5f9e535dkf9a74ab719bb3ece@mail.gmail.com> <4d0b24970612221920l303dee2cua45cc1efa87d13f3@mail.gmail.com> <211709bc0612222103m6eb0bd9bmf8b50c23281786e0@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org I think that exception order not so important. And if the order change will give us performance boost then let's change it! 2006/12/23, Tony Wu : > Hi Andrew, > Thanks for your advice: ) > > Yes, it is impl detail, but this is one kind of problem. Thus I yelled > here for getting an agreement to deal with similar problems. > > I do incline to follow RI in normal case if possible, but harmony's > impl is better here. > I wonder is it worth doing this trade-off? > > On 12/23/06, Andrew Zhang wrote: > > On 12/23/06, Tony Wu wrote: > > > > > > There are two methods, which throw exceptions in different order. > > > > > > public test1(int a, int b){ > > > if(a>b){ > > > throw AException(); > > > } > > > synchronized(obj){ > > > if(blabla){ > > > throw BException(); > > > } > > > } > > > } > > > > > > public test2(int a, int b){ > > > synchronized(obj){ > > > if(blabla){ > > > throw BException(); > > > } > > > if(a>b){ > > > throw AException(); > > > } > > > } > > > } > > > > > > > > > test1 checks the parameters before entering the synchronized block, It > > > returns immediately instead of waiting for a lock in the condition > > > which should throw AException. IMHO, test1 is more elegant. The > > > problem is, if RI do something like the test2 where harmony using > > > test1, should we follow RI here? What's your opinion? > > > > > > I think it's implementation detail, and I vote for following RI if possible. > > > > We may discuss specific case one by one. :) > > > > Thanks. > > > > > > -- > > > Tony Wu > > > China Software Development Lab, IBM > > > > > > > > > > > -- > > Best regards, > > Andrew Zhang > > > > > > > -- > Tony Wu > China Software Development Lab, IBM >