From dev-return-38084-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Fri Sep 04 09:48:08 2009 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 82264 invoked from network); 4 Sep 2009 09:48:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 09:48:08 -0000 Received: (qmail 96925 invoked by uid 500); 4 Sep 2009 09:48:07 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 96833 invoked by uid 500); 4 Sep 2009 09:48:07 -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 96822 invoked by uid 99); 4 Sep 2009 09:48:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 09:48:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of littlee1032@gmail.com designates 209.85.216.192 as permitted sender) Received: from [209.85.216.192] (HELO mail-px0-f192.google.com) (209.85.216.192) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 09:47:59 +0000 Received: by pxi30 with SMTP id 30so597616pxi.18 for ; Fri, 04 Sep 2009 02:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=JEco8HIQ8dcPv/gDf+KfmsvYa3AMuI3w4ga4qu+57C8=; b=ilLodYhqod86Q6DeUZYJS3xMZF0CFG3PhpnTatzTyXOfsz6WilcUlqX4EIf71Y3vAp l8/xm+HaflE/Wn7SDDp4+XYzKtEiIrxeTHjkPC29WGyXLIOqNSVriKCyUsjp+Rpbiwx1 mW4/E0GZYo1AQ/JmBTm6X4sUTbIbLteVsIiOw= 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; b=S+midApF82sMIKsysWlO1dd/bc0sDcG3+zFB0KJ/S5BK58k5jQfiZ1kbdXGOJs3uHE zIa2rdWStVBDc7r74Ojs/uzFliBz26+91GhGWbJaZQo5W+S0G22g8NKTpuOEmpS15zAb XL8UNbUfwy6fi8R9q8zCfQkJfy4RBkQ7wOUeI= MIME-Version: 1.0 Received: by 10.143.20.36 with SMTP id x36mr303871wfi.231.1252057658775; Fri, 04 Sep 2009 02:47:38 -0700 (PDT) In-Reply-To: <4AA0D8C4.6050101@gmail.com> References: <1121321485.1251961652868.JavaMail.jira@brutus> <1013827094.1251972935467.JavaMail.jira@brutus> <5948b71e0909040026g6454c10csc2cf9515a0ad854f@mail.gmail.com> <4AA0D8C4.6050101@gmail.com> Date: Fri, 4 Sep 2009 17:47:38 +0800 Message-ID: <5948b71e0909040247m5ca17cf5hce4fe8eb0cc45770@mail.gmail.com> Subject: Re: [jira] Commented: (HARMONY-6331) [classlib][beans] remove XMLDecoderTest from the exclude list From: Charles Lee To: dev@harmony.apache.org Content-Type: multipart/alternative; boundary=001636e1f95dfd5acc0472bd6364 X-Virus-Checked: Checked by ClamAV on apache.org --001636e1f95dfd5acc0472bd6364 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 4, 2009 at 5:07 PM, Tim Ellison wrote: > On 04/Sep/2009 08:26, Charles Lee wrote: > > Thanks Regis. > > > > The testcase will *pass* on ri and harmony+vme. But failed on > harmony+drlvm. > > The reason cause this difference is due to differenct order returned by > the > > Class.getMethods. > > It seems findMethod in XMLDecoder shoud fix this problem, because it > should > > be order free. > > > > Also I use "*" around the word "pass" when I mentioned result using > harmony > > + vme. It is a fake pass. The exception it throw is "Cannot decide which > > method to call to match get" due to the specific method order it get. The > > senario as follows: > > > > Class A has four method: > > 1. test(int, String) > > 2. test(Integer, Object) > > 3. test(Object, String) > > 4. test(String, Object) > > > > I want to invoke the test with arg null and "aaa", that is > > method.invoke(null, "aaa"). Which method should be invoked? > > RI: NoSuchMethodException > > vme: (mothed order is 4, 1, 2, 3), "Cannot decide which method to call to > > match get", because method 4 and method 2 has the same distance. > > drlvm: (mothd order is 1, 2, 3, 4), method 3 is invoked because it has > the > > smallest distance. > > > > My question is: which method should be invoked? > > Is this a quiz, or are you asking for an opinion? I would hope that the > correct answer could be determined from the Beans spec, otherwise we > should follow the RI's behavior. > Sorry. I am asking for opinion :-) > > I would guess 3, since null is a valid actual parameter for an Object > formal parameter (and an int is not) and String matches exactly. > > I don't think the order should matter. > Order is mater because the logic of findMethod in XMLDecoder. As the example, method 3 has the smallest distance. If the order is (4, 1, 2, 3), findMethod will find 4 and 2 has the same distance then throw an exception. But if the order is (1, 2, 3, 4), method 3 appears before method 4, no exception thrown and findMethod find method 3. I suggest this method should be order free. I will fix this if I know which situation should be correct. > > However, I'm not so familiar with the spec to say whether my 'logical > answer' is the one the spec would give you. > > Regards, > Tim > > > -- Yours sincerely, Charles Lee --001636e1f95dfd5acc0472bd6364--