Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 71027 invoked from network); 22 Jun 2009 09:14:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 09:14:18 -0000 Received: (qmail 58082 invoked by uid 500); 22 Jun 2009 09:14:29 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 58056 invoked by uid 500); 22 Jun 2009 09:14:29 -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 57984 invoked by uid 99); 22 Jun 2009 09:14:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 09:14:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 09:14:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8432D234C1E7 for ; Mon, 22 Jun 2009 02:14:07 -0700 (PDT) Message-ID: <1549701188.1245662047540.JavaMail.jira@brutus> Date: Mon, 22 Jun 2009 02:14:07 -0700 (PDT) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-5973) [classlib] [beans] StandardBeanInfo fails to gain correct indexed read and write methods of a indexed property In-Reply-To: <973107599.1220865166182.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison closed HARMONY-5973. -------------------------------- No response, assuming ok. > [classlib] [beans] StandardBeanInfo fails to gain correct indexed read and write methods of a indexed property > -------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-5973 > URL: https://issues.apache.org/jira/browse/HARMONY-5973 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M6, 5.0M7 > Reporter: Kevin Zhou > Assignee: Tim Ellison > Fix For: 5.0M8 > > Attachments: HARMONY-5973.diff > > Original Estimate: 24h > Remaining Estimate: 24h > > Consider test case [1] and bean class [2], currect Harmony's beans actually use Introspector.getBeanInfo method to introspect the IndexedPropertyDescriptor -- "data". > The return type of normal getter method is incompatible with the type of indexed getter method, which results in the failure of introspection of this property. > In addition, Consider test case [3] and bean class [4], RI's beans will introspect the "data" as a normal property while Harmony's beans will incorrectly regard it as an indexed property. > [1] > public void testMockIncompatibleGetterAndIndexedGetterBean() throws Exception { > Class beanClass = MockIncompatibleGetterAndIndexedGetterBean.class; > BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); > PropertyDescriptor pd = null; > PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors(); > for (int i = 0; i < pds.length; i++) { > pd = pds[i]; > if (pd.getName().equals("data")) { > break; > } > } > assertNotNull(pd); > assertTrue(pd instanceof IndexedPropertyDescriptor); > IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd; > assertNull(ipd.getReadMethod()); > assertNull(ipd.getWriteMethod()); > Method indexedReadMethod = beanClass.getMethod("getData", > new Class[] { int.class }); > Method indexedWriteMethod = beanClass.getMethod("setData", new Class[] { > int.class, int.class }); > assertEquals(indexedReadMethod, ipd.getIndexedReadMethod()); > assertEquals(indexedWriteMethod, ipd.getIndexedWriteMethod()); > } > [2] > public class MockIncompatibleGetterAndIndexedGetterBean { > private int[] datas; > public int getData() { > return datas[0]; > } > public int getData(int index) { > return datas[index]; > } > public void setData(int index, int data) { > this.datas[index] = data; > } > } > [3] > public void testMockIncompatibleGetterAndIndexedGetterBean() throws Exception { > Class beanClass = MockIncompatiblePartBean.class; > BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); > PropertyDescriptor pd = null; > PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors(); > for (int i = 0; i < pds.length; i++) { > pd = pds[i]; > if (pd.getName().equals("data")) { > break; > } > } > assertNotNull(pd); > assertFalse(pd instanceof IndexedPropertyDescriptor); > [4] > public class MockIncompatiblePartBean{ > private int[] datas; > public int getData(){ > return datas[0]; > } > public void setData(int index, int data) { > this.datas[index] = data; > } > public void setData(int data){ > this.datas[0] = data; > } > public void setData(){ > this.datas[0] = 0; > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.