Hi Hui

Unless I'm missing something:

If you are only after the exit points to a method you don't really need to find the end of the catch block because the catch block after it has completed will fall back to the method in which it is contained and exit via the usual return, this is provided it does not throw another exception or cause another exception to be thrown.

I presume you also need to trace exit points from your method even if the exception is not caught or if a RunTimeException is caused? If so perhaps look at the interface org.apache.bcel.generic.ExceptionThrower as this interface is implemented by all bytecodes which could cause an exception to be thrown(including ATHROW and ReturnInstructions) so any instructions implementing ExceptionThrower would seem to mark the possible exits from a method.

Hope this helps

Bye Arrin



[EMAIL PROTECTED] wrote:

Hi,

  I'm currently using BCEL to identify the exit points of a method via
a return statement, and that has worked fine. What is missing now is
identifying exit points via exception (a throw statement in a catch
block)...does anyone have any experience doing this? I read about
exception handling code and it seems like one can identify the beginning
and end of the try block and the beginning of the catch block, but I
don't see how one can identify the end of a catch block (so that I can
iterate through instructions between the start of the catch block and
the end of the catch block to find a throw instruction). Any suggestions?



thanks,
Hui Nee


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Conventional wisdom says to know your limits. To know your limits you need to find them first. Finding you limits generally involves getting in over your head and hoping you live long enough to benefit from the experience. That's the fun part.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to