commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-224) [beanutils] provide better error message for "argument type mismatch"
Date Tue, 07 Nov 2006 05:07:38 GMT
    [ http://issues.apache.org/jira/browse/BEANUTILS-224?page=comments#action_12447635 ] 
            
Henri Yandell commented on BEANUTILS-224:
-----------------------------------------

I've modified 'found' to 'had objects of type' and 'expected' to 'expected signature'.

The expected/found seems like it's going to confuse when inheritance gets into the equation,
so the more verbose ones above seem better to me in making sure that people don't read too
much into the error message.

> [beanutils] provide better error message for "argument type mismatch"
> ---------------------------------------------------------------------
>
>                 Key: BEANUTILS-224
>                 URL: http://issues.apache.org/jira/browse/BEANUTILS-224
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: Operating System: All
> Platform: Other
>            Reporter: Ralf Hauser
>            Priority: Minor
>             Fix For: 1.8.0
>
>         Attachments: PropertyUtilsBean.patch
>
>
> In <<Object org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(Method
> method, Object bean, Object[] values) throws IllegalAccessException,
> InvocationTargetException>> 
> the throw block should rather be:
>             throw new IllegalArgumentException(
>                 "Cannot invoke " + method.getDeclaringClass().getName() + "." 
>                 + method.getName() + " - " + e.getMessage() + " - found " + 
>                 bean.getClass().getName()+ " but expected "
>                 +  (values[0]).getClass().getName());
> see also In <<Object org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(Method
> method, Object bean, Object[] values) throws IllegalAccessException,
> InvocationTargetException>> 
> the throw block should rather be:
>             throw new IllegalArgumentException(
>                 "Cannot invoke " + method.getDeclaringClass().getName() + "." 
>                 + method.getName() + " - " + e.getMessage() + " - found " + 
>                 bean.getClass().getName()+ " but expected "
>                 +  (values[0]).getClass().getName());
> see also Bug 38163 for the context where this would have helped a lot. for the context
where this would have helped a lot.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message