BCEL: Method Invocation Redirection

"Ganesan, Dharmalingam" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Hi,

> I'm new to BCEL. I started using BCEL to do run-time analysis. I have
> question: How to redirect a method invocation to a different method.
> 
> 
> /* Original code */
> public class MyClass {
> 
>     public void start() {
> 
>     }
> 
>     public void kick() {
> 	start();
>     }
> }
> 
> 
> /* New code after redirecting start() method to start(Thread)  should
> look as below */
> 
> public class MyClass {
> 
>     public void start() {
> 
>     }
> 
>     public void start(Thread callerThread) {
>           start();
>     }
> 
>     public void kick() {
>            start(Thread.currentThread());
>     }
> }
> 
> My question is how to do redirection with the kick() method. That is,
> the kick() should call start(Thread), instead of start().
> 
> I learned how to introduce a new method into java class. Therefore, It
> is enough if you can explain me about the redirection.
> 
> Thank you in advance.
> 
> Best Regards,
> Dharma
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.