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

Indexed List Setters no longer work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.2
    • 1.9.3
    • None

    Description

      After upgrading to commons-beanutils 1.9.2 from 1.8.3, I ran into a bug where indexed List setters no longer work.

      Per the documentation at:
      http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.2/apidocs/org/apache/commons/beanutils/package-summary.html
      " As an extension to the JavaBeans specification, the BeanUtils package considers any property whose underlying data type is java.util.List (or an implementation of List) to be indexed as well."

      This no longer appears to be an accurate statement.

      The cause appears to be more strict validation in both org.apache.commons.beanutils.converters.StringConverter.convertToType() and in org.apache.commons.beanutils.converters.AbstractConverter.
      There is now an explicit cast to the target type, which throws an Exception instead of the previous behavior of simply returning the input value unconverted.

      I'll attach a test case that works with 1.8.3, but no longer works with 1.9.2.

      Attachments

        1. BeanUtilsBean.java.patch
          0.9 kB
          Daniel Atallah
        2. BeanUtilsTest.java
          2 kB
          Daniel Atallah

        Activity

          People

            Unassigned Unassigned
            datallah Daniel Atallah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: