Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 28195 invoked from network); 25 Dec 2006 11:50:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Dec 2006 11:50:50 -0000 Received: (qmail 2467 invoked by uid 500); 25 Dec 2006 11:50:51 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 2435 invoked by uid 500); 25 Dec 2006 11:50:51 -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 2426 invoked by uid 99); 25 Dec 2006 11:50:51 -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 03:50:51 -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 wuyuehao@gmail.com designates 66.249.82.235 as permitted sender) Received: from [66.249.82.235] (HELO wx-out-0506.google.com) (66.249.82.235) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Dec 2006 03:50:41 -0800 Received: by wx-out-0506.google.com with SMTP id i26so3566889wxd for ; Mon, 25 Dec 2006 03:50:20 -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=hdlmYpYeVT+wu4louFyCotPhROB2ERXa/vI+wfntlxCEmL+TvUGrfMSHzBFc/oHeKlUxp2/kAD56AoSe4J9yEDG2poCUQfdNey1SPhU7f1wfasoKmEUITQOg/y6Z08AnjS9HKQ9NWYzr0wVtEesVCh1ghKjTuFpQs18FWs2TzRM= Received: by 10.70.75.14 with SMTP id x14mr21661649wxa.1167047420221; Mon, 25 Dec 2006 03:50:20 -0800 (PST) Received: by 10.70.53.15 with HTTP; Mon, 25 Dec 2006 03:50:20 -0800 (PST) Message-ID: <211709bc0612250350v5c5d5899vc410a5c67d474695@mail.gmail.com> Date: Mon, 25 Dec 2006 19:50:20 +0800 From: "Tony Wu" To: dev@harmony.apache.org Subject: Re: [general]what do you think about this kind of exception order? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; 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 So, you mean it is ok to consider them as non-bug difference and there is no need to follow RI. On 12/25/06, Alexey Petrenko wrote: > 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 > > > -- Tony Wu China Software Development Lab, IBM