Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 52650 invoked from network); 14 Jul 2006 18:43:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jul 2006 18:43:19 -0000 Received: (qmail 27876 invoked by uid 500); 14 Jul 2006 18:43:19 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 27847 invoked by uid 500); 14 Jul 2006 18:43:19 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 27753 invoked by uid 99); 14 Jul 2006 18:43:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 11:43:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 11:43:17 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E894241001C for ; Fri, 14 Jul 2006 18:41:15 +0000 (GMT) Message-ID: <10866176.1152902475949.JavaMail.jira@brutus> Date: Fri, 14 Jul 2006 11:41:15 -0700 (PDT) From: "Alexei Zakharov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-882) [classlib][beans] differences in java.beans.Statement behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [classlib][beans] differences in java.beans.Statement behavior -------------------------------------------------------------- Key: HARMONY-882 URL: http://issues.apache.org/jira/browse/HARMONY-882 Project: Harmony Issue Type: Bug Components: Non-bug differences from RI Environment: winXP Reporter: Alexei Zakharov Priority: Minor While trying to enable tests from org.apache.harmony.beans.tests.java.beans.StatementTest I have faced the strange problem. It seems that while building Statement for accessing array elements RI doesn't check the number of parameters of get() method. It simply takes the value of first argument, converts it to integer and does nothing more. Following (IMHO invalid) tests pass on RI: Test1: Object[] array = new Object[] { "test" }; Statement t = new Statement(array, "get", new Object[] { new Integer(0), new Object() }); t.execute(); Test2: Object[] array = new Object[] { "test" }; Statement t = new Statement(array, "get", new Object[] { new Integer(0), new Object(), new Integer[] {1,2,3,4,5,6}, new java.util.GregorianCalendar(), "mama mila ramu" }); t.execute(); The spec states the following: "The method names 'get' and 'set' defined in the java.util.List interface may also be applied to array instances, mapping to the static methods of the same name in the Array class." Therefore, since java.util.List defines 'get' method with excatly one integer argument I suppose the correct test should look like: Test3: Object[] array = new Object[] { "test" }; Statement t = new Statement(array, "get", new Object[] { new Integer(0) }); t.execute(); And Test1 and Test2 should throw NoSuchMethodException as our implementation does. So, the behavior of our implementation differs from RI. But RI's behavior looks unnatural in this case. It was decided [1] we should keep our behavior. [1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3c44B3DDE8.1020904@gmail.com%3e -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira