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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: