FULL PRODUCT VERSION :
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
If java.lang.instrument.Instrumentation.retransformsClasses() is called on a class that had already been loaded, then the jvm doesnt seem to pass in the LocalVariableTable for the methods of the class.
This prevents any instrumentation which needs local variable info.
If the same class is instrumented normally using a transformer as it is loaded the LocalVariableTable is indeed passed.
Is this a bug in the JVM and if so where should this be posted so it gets noticed?
This bug has been verified in both java 6update 20 and update 26.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Write a program that uses a class, say Foo
2. Have some mechanism, maybe a button click which calls java.lang.instrument.Instrumentation.retransformClasses() on Foo, which has already been loaded by the JVM.
3. The byte array passed to the instrumentor in retransformClasses() does not contain the LocalVariableTable of the methods of class Foo.
EXPECTED VERSUS ACTUAL BEHAVIOR :
The LocalVariableTable should be present when instrumenting the class through retransformClasses() method.
The LocalVariableTable is not passed
This bug can be reproduced always.