[
https://issues.apache.org/jira/browse/BEANUTILS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593217#comment-13593217
]
Jaroslav Simak commented on BEANUTILS-419:
------------------------------------------
Hi Benedikt,
as you pointed out, BU 1.6.1 did not throw exception when setting "property[]".
If i remember correctly, when BU 1.6.1 doesn't find an index between square
brackets it removes them from property name and then sets property. In BU 1.8.3
if there is no index between square brackets IAE is thrown. The point is that
after upgrade to 1.8.3 this behaviour broken our app in some use cases because
we were using properties without index between brackets.
Kind Regards,
Jaroslav
> 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