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

(reflect) Need a way to force a class to be initialized.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • core-libs

      There is no direct way to force a class to be initialized. Now that class
      literals do not do that, it would be extremely helpful for there to be a
      direct way to force the initialization. Please add a method

      public Class<T> Class.initialize();

      to force the class to be initialized. That would allow the idiom

      X.class.initialize()

      to be used as a class literal for an initialized class.

            darcy Joe Darcy
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: