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

Require first parameter type of a condy bootstrap to be Lookup

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      binary
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      There is no compatibility risk since constant dynamic was integrated into 11
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psandoz Paul Sandoz
                Reporter:
                psandoz Paul Sandoz
                Reviewed By:
                John Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: