For a particular method, how can I view the checked exceptions in java using reflection?

exception, java, jvm, methods, reflection

Solution

Use this method in `Method`:

`public Type[] getGenericExceptionTypes()`

Then you have to iterate through the types if you want to separate checked and unchecked exceptions.

Problem

For a particular method, how can I view the checked exceptions in java using reflection? There does not seem to be support for this in the JDK.

Original source