Hi,so I have been playing with BCEL for a couple of weeks now and it works
really nice, but I have the following problem:
Consider this java code:
void foo(int x)
{
String a = "aa";
[x] -> localvariables(0=x,1=a) so I need to use 2 and 3
somemethod();
String b = "bb";
[y] -> localvariables(0=x,1=a,2=b) so I need to use 3 and 4
someOthermethod();
}
What I need to do is instrument some synchronized blocks around the methods,
but the thing is that synchronization code will need local variables to
store various values such as the actual monitor object and another for
exception handling to ensure that the monitor is released when something bad
happens. So in the end the code I am going to instrument 'around' something
needs 2 local variable spaces, but ofcourse I don't want to overwrite
anything. How can I do this nicely? It would be great if there would be a
method like getCurrentLocalVariableIndex that would return 1 at [x] and 2 at
[y] but I couldn't find such a thing in the API doc, but there should be
some nice solution to this so, any suggestions?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]