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

IllegalArgumentException when setting property with no index between square brackets

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jaroslav.simak Jaroslav Simak

            Dates

              Created:
              Updated:

              Slack

                Issue deployment