Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5053975

static initializer invoked again after appendToBootstrapClassLoaderSearch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-svc
    • sparc
    • solaris_9



      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)
      ======================================================================

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: