Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 93102 invoked from network); 26 Jul 2007 03:21:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jul 2007 03:21:51 -0000 Received: (qmail 15856 invoked by uid 500); 26 Jul 2007 03:21:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 15827 invoked by uid 500); 26 Jul 2007 03:21:52 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 15818 invoked by uid 99); 26 Jul 2007 03:21:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 20:21:52 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 20:21:50 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 490751A981A; Wed, 25 Jul 2007 20:21:30 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r559680 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/PropertyDescriptor.java test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java Date: Thu, 26 Jul 2007 03:21:30 -0000 To: commits@harmony.apache.org From: tonywu@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070726032130.490751A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tonywu Date: Wed Jul 25 20:21:29 2007 New Revision: 559680 URL: http://svn.apache.org/viewvc?view=rev&rev=559680 Log: Fix bug: did not check the arguments number for default get method Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java?view=diff&rev=559680&r1=559679&r2=559680 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java (original) +++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java Wed Jul 25 20:21:29 2007 @@ -246,8 +246,10 @@ Method[] methods = beanClass.getMethods(); for (Method method : methods) { if (method.getName().equals(setterName)) { - writeMethod = method; - break; + if (method.getParameterTypes().length == 1) { + writeMethod = method; + break; + } } } } Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java?view=diff&rev=559680&r1=559679&r2=559680 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java (original) +++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java Wed Jul 25 20:21:29 2007 @@ -771,6 +771,33 @@ assertEquals(String[].class, ipd.getPropertyType()); assertEquals("set" + anotherProp, ipd.getIndexedWriteMethod().getName()); } + + public void testIndexedPropertyDescriptorStringClassStringStringStringString_WrongArgumentNumber() + throws IntrospectionException { + IndexedPropertyDescriptor ipd = new IndexedPropertyDescriptor("a", DummyClass.class, null, "setAI", + "getAI", "setAI"); + assertNotNull(ipd); + } + + private class DummyClass { + private int[] a; + + public void setAI(int v, int i) { + a[i] = v; + } + + public void setAI(int[] a) { + this.a = a; + } + + public int[] getA() { + return a; + } + + public int getAI(int i) { + return a[i]; + } + } /* * Class under test for void IndexedPropertyDescriptor(String, Method,