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

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

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: