< prev index next >

test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java

Print this page
*** 19,10 ***
--- 19,12 ---
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
+ // -- This file was mechanically generated: Do not edit! -- //
+ 
  /*
   * @test
   * @bug 8156486
   * @run testng/othervm VarHandleTestMethodTypeLong
   * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=true -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true VarHandleTestMethodTypeLong

*** 43,10 ***
--- 45,12 ---
  import static org.testng.Assert.*;
  
  import static java.lang.invoke.MethodType.*;
  
  public class VarHandleTestMethodTypeLong extends VarHandleBaseTest {
+     static final Class<?> type = long.class;
+ 
      static final long static_final_v = 0x0123456789ABCDEFL;
  
      static long static_v = 0x0123456789ABCDEFL;
  
      final long final_v = 0x0123456789ABCDEFL;

*** 64,20 ***
      VarHandle vhArray;
  
      @BeforeClass
      public void setup() throws Exception {
          vhFinalField = MethodHandles.lookup().findVarHandle(
!                 VarHandleTestMethodTypeLong.class, "final_v", long.class);
  
          vhField = MethodHandles.lookup().findVarHandle(
!                 VarHandleTestMethodTypeLong.class, "v", long.class);
  
          vhStaticFinalField = MethodHandles.lookup().findStaticVarHandle(
!             VarHandleTestMethodTypeLong.class, "static_final_v", long.class);
  
          vhStaticField = MethodHandles.lookup().findStaticVarHandle(
!             VarHandleTestMethodTypeLong.class, "static_v", long.class);
  
          vhArray = MethodHandles.arrayElementVarHandle(long[].class);
      }
  
      @DataProvider
--- 68,20 ---
      VarHandle vhArray;
  
      @BeforeClass
      public void setup() throws Exception {
          vhFinalField = MethodHandles.lookup().findVarHandle(
!                 VarHandleTestMethodTypeLong.class, "final_v", type);
  
          vhField = MethodHandles.lookup().findVarHandle(
!                 VarHandleTestMethodTypeLong.class, "v", type);
  
          vhStaticFinalField = MethodHandles.lookup().findStaticVarHandle(
!             VarHandleTestMethodTypeLong.class, "static_final_v", type);
  
          vhStaticField = MethodHandles.lookup().findStaticVarHandle(
!             VarHandleTestMethodTypeLong.class, "static_v", type);
  
          vhArray = MethodHandles.arrayElementVarHandle(long[].class);
      }
  
      @DataProvider

*** 1001,19 ***
  
      static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeLong recv, Handles hs) throws Throwable {
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
                      invokeExact(Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class)).
                      invokeExact(0);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
                  Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class)).
--- 1005,19 ---
  
      static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeLong recv, Handles hs) throws Throwable {
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class)).
                      invokeExact(Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class)).
                      invokeExact(0);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
                  Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class)).

*** 1023,229 ***
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class)).
                      invokeExact(recv);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 hs.get(am, methodType(void.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
                  hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 hs.get(am, methodType(void.class, int.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
                      invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , long.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
                      invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class , long.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  
--- 1027,229 ---
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class)).
                      invokeExact(recv);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 hs.get(am, methodType(void.class, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
                  hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 hs.get(am, methodType(void.class, int.class, type)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, type, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, type, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, Class.class, type)).
                      invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , type, type)).
                      invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type, type, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, type, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, Class.class, type)).
                      invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class , type, type)).
                      invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class , type, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class , type, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type, type, Class.class)).
                      invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, type)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, type)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, type)).
                      invokeExact(0, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, VarHandleTestMethodTypeLong.class, type)).
                      invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  

*** 1859,139 ***
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 hs.get(am, methodType(void.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  
--- 1863,139 ---
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 hs.get(am, methodType(void.class, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, type, type)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type, type)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              // Incorrect argument types
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type)).
                      invokeExact(0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact(0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  

*** 2975,23 ***
          Arrays.fill(array, 0x0123456789ABCDEFL);
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class)).
                      invokeExact((long[]) null, 0);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class)).
                      invokeExact(Void.class, 0);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class)).
                      invokeExact(0, 0);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class)).
                      invokeExact(array, Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
                  Void x = (Void) hs.get(am, methodType(Void.class, long[].class, int.class)).
--- 2979,23 ---
          Arrays.fill(array, 0x0123456789ABCDEFL);
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class)).
                      invokeExact((long[]) null, 0);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, int.class)).
                      invokeExact(Void.class, 0);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, int.class)).
                      invokeExact(0, 0);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, Class.class)).
                      invokeExact(array, Void.class);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
                  Void x = (Void) hs.get(am, methodType(Void.class, long[].class, int.class)).

*** 3001,39 ***
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class)).
                      invokeExact(array, 0);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 hs.get(am, methodType(void.class, long[].class, int.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 hs.get(am, methodType(void.class, Class.class, int.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
                  hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 hs.get(am, methodType(void.class, int.class, int.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 hs.get(am, methodType(void.class, long[].class, Class.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
--- 3005,39 ---
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class)).
                      invokeExact(array, 0);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 hs.get(am, methodType(void.class, long[].class, int.class, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 hs.get(am, methodType(void.class, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
                  hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 hs.get(am, methodType(void.class, int.class, int.class, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 hs.get(am, methodType(void.class, long[].class, Class.class, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).

*** 3045,212 ***
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, long.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, Class.class, long.class)).
                      invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, long.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, Class.class, long.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class, long.class)).
                      invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(long.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  }
--- 3049,212 ---
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, type, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, Class.class, type)).
                      invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, type, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, Class.class, type, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, int.class, type, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // expected reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, Class.class, type)).
                      invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // actual reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, int.class, type, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, Class.class, type, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, type, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, int.class, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, Class.class, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, int.class, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, Class.class, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type)).
                      invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
!                 long x = (long) hs.get(am, methodType(type, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // value reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
!                 long x = (long) hs.get(am, methodType(type, int.class, int.class, type)).
                      invokeExact(0, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // index reference class
!                 long x = (long) hs.get(am, methodType(type, long[].class, Class.class, type)).
                      invokeExact(array, Void.class, 0x0123456789ABCDEFL);
              });
              // Incorrect return type
              checkWMTE(() -> { // reference class
!                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              checkWMTE(() -> { // primitive class
!                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, type)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
!                 long x = (long) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
!                 long x = (long) hs.get(am, methodType(type, long[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
              });
          }
      }
  }
< prev index next >