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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 8
    • Affects Version/s: 8
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: