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

Calling VarHandle.{access-mode} methods reflectively throws wrong exception

XMLWordPrintable

    • b10
    • generic
    • generic

      The signature polymorphic methods in VarHandle need special casing similar to invoke/invokeExact in MethodHandle. The relevant section of the Java SE API specification says that an UnsupportedOperationException is thrown when invoking such a method using reflections. The same wording is used in MethodHandle.
      (https://github.com/openjdk/jdk/blob/d7b941640638b35f9ac1ef11cd6bf6ccb795c29a/src/java.base/share/classes/java/lang/invoke/VarHandle.java#L435-L442)

      However, the VarHandle methods currently throw an UnsatisfiedLinkError instead.

            hgreule Hannes Greule
            hgreule Hannes Greule
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: