[
https://issues.apache.org/jira/browse/BEANUTILS-17?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Niall Pemberton updated BEANUTILS-17:
-------------------------------------
Fix Version/s: 1.8.0
> [beanutils] IllegalArgumentException in BeanUtils.copyProperties when
> property types don't match
> ------------------------------------------------------------------------------------------------
>
> Key: BEANUTILS-17
> URL: https://issues.apache.org/jira/browse/BEANUTILS-17
> Project: Commons BeanUtils
> Issue Type: Bug
> Affects Versions: 1.6
> Environment: Operating System: other
> Platform: All
> Reporter: Matthew Sgarlata
> Fix For: 1.8.0
>
> Attachments: bug27633 _response.txt
>
>
> (this report applies to BeanUtils 1.6.1)
> When using BeanUtils.copyProperties, if the source and destination beans have
> properties of the same name but with different types, the system throws a
> java.lang.IllegalArgumentException. This is NOT recorded as a thrown
> exception
> in the BeanUtils.copyProperties API. I think that this only happens if a
> Converter is not registered for the object.
> I personally think throwing an exception is a bug and that copyProperties
> should just fail silently (i.e. - don't populate that property of the
> destination bean). However, if an exception is deemed most appropriate by
> the
> committers, I think it should be added to the contract of the method. If a
> committer could weigh-in on this issue and decide which behavior is most
> appropriate, I can submit the needed patch.
> Here is the stack trace I got:
> java.lang.IllegalArgumentException: argument type mismatch
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty
> (PropertyUtils.java:1789)
> at org.apache.commons.beanutils.BeanUtils.copyProperty
> (BeanUtils.java:450)
> at org.apache.commons.beanutils.BeanUtils.copyProperties
> (BeanUtils.java:264)
> at com.bah.jroc.ws.CapabilityServiceSoapBindingImpl.getCapability
> (CapabilityServiceSoapBindingImpl.java:58)
> at com.bah.jroc.ws.CapabilityServiceSoapBindingSkeleton.getCapability
> (CapabilityServiceSoapBindingSkeleton.java:55)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.axis.providers.java.RPCProvider.invokeMethod
> (RPCProvider.java:397)
> at org.apache.axis.providers.java.RPCProvider.processMessage
> (RPCProvider.java:304)
> at org.apache.axis.providers.java.JavaProvider.invoke
> (JavaProvider.java:329)
> at org.apache.axis.strategies.InvocationStrategy.visit
> (InvocationStrategy.java:71)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:157)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:122)
> at org.apache.axis.handlers.soap.SOAPService.invoke
> (SOAPService.java:517)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:324)
> ... etc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]