Hi Bil
My understanding is that the Local Variable Table is an optional
inclusion with a method.
A method does not need to have a Local Varible Table, If it does have a
LVT I am not sure whether or not it is required to be correct.
I don't know the specifics of your project but it might be worthwhile
considering the possibility that some code will not have a local
variable table at all or if it is the information in the local variable
table is incorrect.
org.apache.bcel.generic.Type has a couple of static methods which
convert either type signatures to a Type object or a method signature to
an array of Types. (see getType(String) and getArgumentTypes(String))
these mean you don't have to manually parse the method signature.
Hope this helps
Bye Arrin
Bil Lewis wrote:
Hi all.
I've just been trying to update my code to run on code compiled under
1.5.
Almost everything works flawlessly. Just this one thing...
For code like this:
static void startTarget(Class clazz) { // Only called from event thread.
final Class clazzz = clazz;
new TestInnerClass() {
public void run() {
Class c = clazzz;
}
};
}
where the variable clazzz must be passed to the inner class
TestInnerClass$1, the 1.5
compiler does not include it in the LVT, unlike 1.4. Here's the
constructor in question:
TestInnerClass$1(java.lang.Class);
Signature: (Ljava/lang/Class;)V
Code:
0: aload_0
1: aload_1
2: putfield #11; //Field val$clazzz:Ljava/lang/Class;
5: aload_0
6: invokespecial #14; //Method TestInnerClass."<init>":()V
9: return
LineNumberTable:
line 1: 0
line 10: 5
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 this LTestInnerClass$1;
As is clear, the parameter in register 1 is not in the LVT. As near as
I've been able to make
out, the only way to find out that it even exists is to parse the
string in the signature. This
seems like an exceedingly awkward thing to do.
Ideas?
-Bil
---------------------------------------------------------------------
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]