(reflect) Define ReflectionException

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 6
    • Component/s: core-libs
    • None

      There are many reflection related exceptions, such as ClassNotFoundException, InstantiationException,IllegalAccessException,InvocationTargetException, NoSuchFieldException, and NoSuchMethodException, but they do not share any common exception type other than Exception, so people are forced to write "catch(Exception)", which has undesirable side-effect of catching RuntimeException.

      It would be really nice to introduce ReflectionException as the common base exception for all reflection-related exceptions to mitigate this pain. This is analogous to how IOException has a lot of sub-types.

      See http://weblogs.java.net/blog/kohsuke/archive/2006/10/closures_and_la.html for a related rant and how people reacted to this.

            Assignee:
            Joe Darcy
            Reporter:
            Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: