Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-419

IllegalArgumentException when setting property with no index between square brackets

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.8.3
    • 2.0.0
    • Bean / Property Utils
    • None
    • Sun Java 6
      Fedora 17

    Description

      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;
              }
      
          }
      
      }
      

      Doesnt fail with BeanUtils 1.6.1
      Fails with BeanUtils 1.8.3

      Attachments

        Activity

          People

            Unassigned Unassigned
            jaroslav.simak Jaroslav Simak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: