jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: getting target of BranchInstruction
Date Fri, 27 Sep 2002 06:20:48 GMT

Hi,
I use this :
.........
GOTO goto = new GOTO(null);
......................
InstructionHandle handle = il.append(goto);
........
InstructionHandle endIf = il.append( someInstruction );
goto.setTarget(endIf);
........................

use handles in "addExceptionHandler".
I believe it will return valid target after  "setTarget", but I never need
"getTarget" method.

----- Original Message -----
From: "Abel Wang" <xandersparks@hotmail.com>
To: <bcel-user@jakarta.apache.org>
Sent: Friday, September 27, 2002 1:30 AM
Subject: getting target of BranchInstruction


> Hello BCel users,
>
> I'm trying to get the target instruction handle from the GOTO instruction
> off of a try catch block.  In Java, it looks something like this:
>
> try {
>     <Whatever1>
> }
> catch(Exception e) {
>
>     <Whatever2>
> }
>
> System.out.println("done");
>
> What I'm trying to do is given the GOTO instruction at the end of
> <whatever1>, i want to get an index to the instruction which begins the
> System.out.println("done") command.  I'm trying
> BranchInstruction.getTarget() but it always returns null.  What is the
> proper way for me to do this?
>
> Thanks,
>
> --Abel
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> To unsubscribe, e-mail:
<mailto:bcel-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:bcel-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>


Mime
View raw message