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

[lworld] MethodHandle lookup fails with asBoxType() class in MethodType

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: core-libs
    • Labels:

      Description

      The following lookup fails:

                  MethodType test18_mt = MethodType.methodType(void.class, MyValue1.class.asBoxType());
                  test18_mh1 = lookup.findStatic(clazz, "test18_target1", test18_mt);

          static void test18_target1(MyValue1.box vt) {
              nullValue = vt;
          }


      java.lang.NoSuchMethodException: no such method: compiler.valhalla.valuetypes.TestNullableValueTypes.test19_target1(MyValue1.box)void/invokeStatic
      at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:983)
      at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1121)
      at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:2034)
      at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:1106)
      at compiler.valhalla.valuetypes.TestNullableValueTypes.<clinit>(TestNullableValueTypes.java:78)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:320)
      at compiler.valhalla.valuetypes.ValueTypeTest.main(ValueTypeTest.java:256)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.NoSuchMethodError: compiler.valhalla.valuetypes.TestNullableValueTypes.test19_target1(Qcompiler/valhalla/valuetypes/MyValue1;)V
      at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
      at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1090)
      at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1118)
      ... 12 more
      java.lang.ExceptionInInitializerError
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:320)
      at compiler.valhalla.valuetypes.ValueTypeTest.main(ValueTypeTest.java:256)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.RuntimeException: Method handle lookup failed
      at compiler.valhalla.valuetypes.TestNullableValueTypes.<clinit>(TestNullableValueTypes.java:82)
      ... 9 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                thartmann Tobias Hartmann
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: