1 May 2003 18:21
Adding Exception Handler
Alon Albert <al <at> merc-int.com>
2003-05-01 16:21:32 GMT
2003-05-01 16:21:32 GMT
I am adding an exception handler to existing code. However, the MethodGen class only allows me to add the handler to the end of the exception table. This causes a problem since the JVM processes exceptions in order so if my exception is nested within an existing exception, my new handler will not get called. I managed to solve this by clearing the exception table (MethodGen.removeExceptionHandlers()) and then adding my new exception before restoring the old exceptions. However, this isn't a very eficient way of doing this. I can't even derive from MethodGen to solve this since the exception_vec is declared private rather than protected. Am I missing something here or is this an oversight of BCEL?
RSS Feed