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

Require first parameter type of a condy bootstrap to be Lookup

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 11
    • core-libs
    • None
    • binary
    • minimal
    • There is no compatibility risk since constant dynamic was integrated into 11
    • Java API
    • SE

      Summary

      Constrain constant dynamic bootstrap methods to methods whose first parameter type is MethodHandles.Lookup.

      Problem

      It's not easy to use existing methods as constant dynamic bootstrap methods. A level of indirection is required, either explicitly or via use of the bootstrap method ConstantBootstraps.invoke to drop the first three arguments of lookup, name, and type. While this change does not address that problem it will ensure the problem can be addressed in a future release without affecting compatibility of existing constant dynamic bootstrap methods.

      Solution

      Constrain constant dynamic bootstrap methods to methods whose first parameter type is MethodHandles.Lookup.

      Specification

      The VM specification will require updating, tracked by JDK-8199051. The java/lang/invoke/package-html.java has been updated (see attached).

            psandoz Paul Sandoz
            psandoz Paul Sandoz
            John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: