[ 
https://issues.apache.org/jira/browse/BEANUTILS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588780#comment-13588780
 ] 

Benedikt Ritter commented on BEANUTILS-419:
-------------------------------------------

Hi Jaroslav,

maybe I haven't understood this yet but what BU 1.8.3 does seems to be the 
right thing. The property is called "property" so why should it be possible to 
set it using "property[]" as a name. If BU 1.6.1 had a different handling it's 
possible that this has been corrected.
                
> IllegalArgumentException when setting property with no index between square 
> brackets
> ------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-419
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-419
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>         Environment: Sun Java 6
> Fedora 17
>            Reporter: Jaroslav Simak
>            Priority: Minor
>
> {noformat}
> public class BeanUtilsTest {
>     @Test
>     public void testSetPropertyWithNoIndexBetweenSquareBrackets() throws 
> IllegalAccessException, InvocationTargetException {
>         // GIVEN
>         final SimpleBean bean = new SimpleBean();
>         final String propName = "property[]";
>         final String value = "myValue";
>         // WHEN
>         BeanUtils.setProperty(bean, propName, value);
>         // THEN
>         // Should not fail
>     }
>     public static class SimpleBean {
>         private String property;
>         public String getProperty() {
>             return property;
>         }
>         public void setProperty(String property) {
>             this.property = property;
>         }
>     }
> }
> {noformat}
> Doesnt fail with BeanUtils 1.6.1
> Fails with BeanUtils 1.8.3

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to