You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Chris McFarland (JIRA)" <ji...@apache.org> on 2018/03/19 18:53:00 UTC

[jira] [Commented] (BEANUTILS-508) BeanUtilsBean convertForCopy does not convert null values

    [ https://issues.apache.org/jira/browse/BEANUTILS-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16405276#comment-16405276 ] 

Chris McFarland commented on BEANUTILS-508:
-------------------------------------------

It looks like this bug was introduced in version 1.9.0 when generics handling was added.

> BeanUtilsBean convertForCopy does not convert null values
> ---------------------------------------------------------
>
>                 Key: BEANUTILS-508
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-508
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.9.0, 1.9.1, 1.9.2, 1.9.3
>            Reporter: Chris McFarland
>            Priority: Major
>
> BeanUtilsBean convertForCopy(value, type) only calls convert(value, type) for non-null 'value'. This is incorrect because null value handling should be left up to the Converter implementation. As stated in [AbstractConverter javadoc|http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.3/apidocs/org/apache/commons/beanutils/converters/AbstractConverter.html]: the AbstractConverter(Object defaultValue) constructor sets the "default value to be returned if the value to be converted is missing or an error occurs converting the value."



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)