Name: gm110360 Date: 05/27/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
SunOS mary 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Blade-100
A DESCRIPTION OF THE PROBLEM :
Static initializer of an already initialized class is invoked again after java.lang.instrument.Instrumentation.appendToBootstrapClassLoaderSearch.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the classes given and execute with java -javaagent:Teste Foo
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
<clinit>
ACTUAL -
<clinit>
<clinit>
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Foo {
public static void main(String[] args) { Teste.method(); }
}
public class Teste {
static { System.out.println("<clinit>"); }
public static void main(String[] args) { method(); }
public static void method() { }
public static void premain(String args, java.lang.instrument.Instrumentation instr) {
instr.appendToBootstrapClassLoaderSearch(".");
}
}
---------- END SOURCE ----------
(Incident Review ID: 275283)
======================================================================
- duplicates
-
JDK-5055293 java.lang.instrument: can't change classloader search after init
- Resolved
- relates to
-
JDK-5055291 JVMTI Spec: Restrict AddToBootstrapClassLoaderSearch to OnLoad phase only
- Resolved
-
JDK-5053831 IllegalAccessError after Instrumentation.appendToBootstrapClassLoaderSearch
- Closed