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

Niall Pemberton commented on BEANUTILS-349:
-------------------------------------------

I found when testing with JDK 1.3 and 1.4 that Method.invoke() throws a 
NullPointerException if a value is null for a primitive parameter (whereas JDK 
1.5+ throws an IllegalArgumentException) - so I have made an additional change 
so that BeanUtils works the same way whatever the JDK version:

http://svn.apache.org/viewvc?view=rev&revision=822777

> copyProperties throws NullPointerException if an IllegalArgumentException is 
> thrown due to a null value parameter for a primitive
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-349
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-349
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.0
>            Reporter: Eivind Tagseth
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 1.8.1
>
>         Attachments: PropertyUtilsBean.patch
>
>
> When using copyProperties from a bean with a Boolean field to a bean with a 
> corresponding boolean field (i.e. a primitive), an IllegalArgumentException 
> is thrown when calling method.invoke.  invokeMethod tries to format a user 
> friendly exception string, but fails to check if the value parameter is null 
> before getting it's classname.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to