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

MethodHandleInfo throws exception when method handle is to a method with @CallerSensitive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • core-libs
    • b108
    • generic
    • generic
    • Verified

    Description

      When the referenced method is annotated @CallerSensitive, MethodHandles.maybeBindCaller() creates an alias for the method handle -- not a DirectMethodHandle. A MethodHandleInfo can only be created for a DirectMethodHandle (or an AsVarargsCollector) -- throwing an IllegalArgumentException in other cases. This makes MethodHandleInfo an unreliable tool for cracking method handles.

      The lambda metafactory depends on using MethodHandleInfo. See blocked issue JDK-8020816 for an example with detail.

      Attachments

        Issue Links

          Activity

            People

              rfield Robert Field (Inactive)
              rfield Robert Field (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: