[
https://issues.apache.org/jira/browse/SANDBOX-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benedikt Ritter resolved SANDBOX-441.
-------------------------------------
Resolution: Fixed
I added checks for instantiability invokeConstructor(). I also changed
newInstance() to delegate to the private invokeConstructor() method with no
arguments. This way we can be sure that every call to a constructor will be
checked. Committed in r1445335.
> [BeanUtils2] Handling of types that can not be instantiated in
> DefaultClassAccessor 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