You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ralf Hauser (JIRA)" <ji...@apache.org> on 2014/07/23 15:52:38 UTC

[jira] [Commented] (BEANUTILS-464) NullPointerException in PropertyUtilsBean.invokeMethod()

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

Ralf Hauser commented on BEANUTILS-464:
---------------------------------------

The javadoc says: 'Copy property values from the "origin" bean to the "destination" bean for all cases where the property names are the same'

It doesn't say that there will be a null-pointer for the properties that are not present in the origin.

in the v1.9.1 the problem was still there on line 2167  
http://grepcode.com/file/repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.1/org/apache/commons/beanutils/PropertyUtilsBean.java/

> NullPointerException in PropertyUtilsBean.invokeMethod()
> --------------------------------------------------------
>
>                 Key: BEANUTILS-464
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-464
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0
>         Environment: debian stable, java7
>            Reporter: Ralf Hauser
>
> 	at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2168)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2141)
> 	at org.apache.commons.beanutils.PropertyUtilsBean.copyProperties(PropertyUtilsBean.java:291)
> 	at org.apache.commons.beanutils.PropertyUtils.copyProperties(PropertyUtils.java:183)
> How to reproduce: 
> 1) the destination object has a method setId(int id) - the origin doesn't
> 2) values[0] is then null  in 
>   2168                    valueString += (values[i]).getClass().getName();



--
This message was sent by Atlassian JIRA
(v6.2#6252)