You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2013/02/10 22:03:12 UTC

[jira] [Created] (SANDBOX-441) [BeanUtils2] Handling of InstantiationException in DefaultClassAccessor.newInstance() should be improved to give users better feedback

Benedikt Ritter created SANDBOX-441:
---------------------------------------

             Summary: [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
            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