Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Nightly Builds
-
None
Description
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