[ https://issues.apache.org/jira/browse/BEANUTILS-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated BEANUTILS-35: ------------------------------------- Attachment: BEANUTILS-35-PropertyUtilsBean-getPropertyType.patch I agree there are IMO flaws in how BeanUtilsBean's setProperty() method determines the type to convert to for simple properties that have indexed or mapped descriptors. I started work on a new getPropertyType() method for PropertyUtilsBean that I believe resolves these and could be used to replace that logic in BeanUtilsBean's setProperty() method. Attaching a patch to demonstrate the idea - I haven't yet tested this method or tried plugging it into BeanUtilsBean's setProperty() method. Also need to review if there are any adverse implications on compatibility of implementing this. P.S. If this approach is OK then also use for LocaleBeanUtils. > Indexed properties with Array type cause IllegalArgumentException in > setProperty/populate > ----------------------------------------------------------------------------------------- > > Key: BEANUTILS-35 > URL: https://issues.apache.org/jira/browse/BEANUTILS-35 > Project: Commons BeanUtils > Issue Type: Bug > Components: Bean / Property Utils > Affects Versions: 1.7.0 > Environment: Operating System: All > Platform: All > Reporter: David Wood > Assignee: Niall Pemberton > Fix For: 1.8.0 > > Attachments: ArrayIndexedProperty.patch, > BEANUTILS-35-PropertyUtilsBean-getPropertyType.patch, > beanutils-indexed-arrays.patch > > > If you attempt: > public String[] getIndexedArrayProperty(int index) > public void setIndexedArrayProperty(int index,String newvalue[]) > ...this will fail with an IllegalArgumentException in PropertyUtilsBean, > because > setProperty will decide to store the first element of the newvalue array > rather > than the whole array. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]