[
https://issues.apache.org/jira/browse/CONFIGURATION-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906680#comment-13906680
]
Shen liang commented on CONFIGURATION-566:
------------------------------------------
If you mean the full unit testing, I didn't really run them after remove
"isWriteable()" but from the source code, I don't think the removing will cause
any issue. From the configuration library angle, the removing is better since
it can increase range of supported type.
Hope soon can see the upgrade version so I can remove my own fix classes.
Thanks.
> BeanHelper.createBean() can't support Map<> bean property loading from file
> ---------------------------------------------------------------------------
>
> Key: CONFIGURATION-566
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-566
> Project: Commons Configuration
> Issue Type: Bug
> Components: Type conversion
> Affects Versions: 1.10
> Reporter: Shen liang
>
> The issue is BeanUtils.setProperty() can support the java Map bean to set the
> (key, value) entry. But the BeahHelper.initProperty() add 1 more
> PropertyUtils.isWriteable() check. While this PropertyUtils.isWriteable()
> doesn't support java Map bean.
> The check "PropertyUtils.isWriteable()" is quite redundant and unnecessary.
>
> Is it better to remove the check "PropertyUtils.isWriteable()" since the
> BeanUtils.setProperty() has various ways to set the properties?
> {noformat}
> BeanHelper.createBean()
> -> DefaultBeanFactory.createBean()
> -> DefaultBeanFactory.initBeanInstance()
> -> BeanHelper.initBean()
> ->BeahHelper.initProperty()
> {
> if (!PropertyUtils.isWriteable(bean, propName))
> ...
> BeanUtils.setProperty(bean, propName, value);
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)