I can accomplish the above by doing an :
| ctMethod.insertAfter("System.out.println(\"After Foo\"", true).
|
and then an:
ctMethod.insertBefore("System.out.println(\"Before Foo\"");
However I cannot seem to access a local variable in the finally for example:
| long start = System.currrentTimeMillis();
| System.out.println("Before Foo");
| try {
| System.out.println("Foo");
| } finally {
| long end = System.currentTimeMillis();
| System.out.println("Foo too:" + (end - start));
| }
|
The problem is when I am altering the method for the finally, I cannot access the start
variable I introduced.
Any tips would be welcomed.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176376#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...