[
https://issues.apache.org/jira/browse/SANDBOX-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13575526#comment-13575526
]
Benedikt Ritter commented on SANDBOX-441:
-----------------------------------------
This does not only apply to newInstance but also to the other invokeConstructor
methods.
> [BeanUtils2] Handling of InstantiationException in
> DefaultClassAccessor.newInstance() should be improved to give users better
> feedback
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SANDBOX-441
> URL: https://issues.apache.org/jira/browse/SANDBOX-441
> Project: Commons Sandbox
> Issue Type: Improvement
> Components: BeanUtils2
> Affects Versions: Nightly Builds
> Reporter: Benedikt Ritter
> Assignee: Benedikt Ritter
> Priority: Minor
> Fix For: Nightly Builds
>
>
> The handling of InstantiationException could be improved to give users a
> better feedback of what went wrong (see JavaDoc of Class<T>.newInstance() for
> reasons why instantiation may fail):
> * check if a default constructor is available and throw
> NoSuchConstructorException if not
> * else throw BeanInstantiationException but inspect beanType in
> BeanInstantiationException and set specific messages for the following cases:
> ** BeanType is abstract
> ** BeanType is an interface
> ** BeanType is a primitive type
> ** BeanType is an array type
> ** BeanType represents void
> ** if none of the above use a generic message
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira