I have an InstructionHandle containing an InvokeVirtual instruction and I would like to get the list of all declared exceptions thrown by the virtual method invocation. I have tried the following:
1. Get the InvokeVirtual instruction from handle 2. Get the ReferenceType from the instruction 3. Cast the ReferenceType to an ObjectType when safe to do so. 4. Get the class name from the ObjectType 5. Get the Class object from the class name via Class.forName(className) 6. Get an array of methods for the Class 7. Get the method name from the InvokeVirtual instruction 8. Find the java.lang.reflect.Method in the array with the given name 9. Get an array of exception Classes from the method This should be sufficient, but in the environment that I am working in, there are multiple class loaders and the class lookup (Class.forName) is failing. Does anyone know how to do something equivalent in BCEL alone without requiring the use of Java reflection or class lookups? Thanks, Elliot
