You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Daniel Atallah (JIRA)" <ji...@apache.org> on 2014/09/11 23:08:33 UTC

[jira] [Updated] (BEANUTILS-465) Indexed List Setters no longer work

     [ https://issues.apache.org/jira/browse/BEANUTILS-465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Atallah updated BEANUTILS-465:
-------------------------------------
    Attachment: BeanUtilsTest.java

The attached test case throws the following Exception in 1.9.2:
{noformat}
Exception in thread "main" org.apache.commons.beanutils.ConversionException: Default conversion to List failed.
	at org.apache.commons.beanutils.converters.AbstractConverter.handleMissing(AbstractConverter.java:314)
	at org.apache.commons.beanutils.converters.AbstractConverter.handleError(AbstractConverter.java:269)
	at org.apache.commons.beanutils.converters.AbstractConverter.convert(AbstractConverter.java:177)
	at org.apache.commons.beanutils.converters.ConverterFacade.convert(ConverterFacade.java:61)
	at org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:491)
	at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1000)
	at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:454)
	at BeanUtilsTest.main(BeanUtilsTest.java:31)
Caused by: org.apache.commons.beanutils.ConversionException: Can't convert value '' to type interface java.util.List
	at org.apache.commons.beanutils.converters.AbstractConverter.conversionException(AbstractConverter.java:473)
	at org.apache.commons.beanutils.converters.StringConverter.convertToType(StringConverter.java:96)
	at org.apache.commons.beanutils.converters.AbstractConverter.handleMissing(AbstractConverter.java:312)
	... 7 more
{noformat}

> Indexed List Setters no longer work
> -----------------------------------
>
>                 Key: BEANUTILS-465
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-465
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: ConvertUtils & Converters
>    Affects Versions: 1.9.2
>            Reporter: Daniel Atallah
>         Attachments: BeanUtilsTest.java
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)