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

Binder use of MethodHandles.publicLookup is bogus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • repo-panama
    • repo-panama
    • tools

      The binder currently uses MethodHandles::publicLookup in order to fetch a method handle given a reflective Method.

      However, since the binder code is in java.base, which doesn't read the user module, a normal MethodHandle::lookup will be unable to get there.

      For this reason the code uses MethodHandles::publicLookup instead, which works as long as the method lives in an unconditionally exported package.

      While this has been acceptable so far, if the user code also lives in a module and the method to be unreflected lives in a non-exported package, the binder will fail to look that up. Some other solution is thus required.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: