< prev index next >

test/jdk/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.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 VarHandleTestMethodTypeString
   * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=true -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true VarHandleTestMethodTypeString

@@ -43,10 +45,12 @@
  import static org.testng.Assert.*;
  
  import static java.lang.invoke.MethodType.*;
  
  public class VarHandleTestMethodTypeString extends VarHandleBaseTest {
+     static final Class<?> type = String.class;
+ 
      static final String static_final_v = "foo";
  
      static String static_v = "foo";
  
      final String final_v = "foo";

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

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

@@ -669,155 +673,155 @@
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class)).
                      invokeExact(recv);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.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, VarHandleTestMethodTypeString.class, String.class)).
+                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, type)).
                      invokeExact((VarHandleTestMethodTypeString) null, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
-                 hs.get(am, methodType(void.class, Class.class, String.class)).
+                 hs.get(am, methodType(void.class, Class.class, type)).
                      invokeExact(Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // value reference class
                  hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
-                 hs.get(am, methodType(void.class, int.class, String.class)).
+                 hs.get(am, methodType(void.class, int.class, type)).
                      invokeExact(0, "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, String.class, Class.class)).
+                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeString.class, type, Class.class)).
                      invokeExact(recv, "foo", 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, VarHandleTestMethodTypeString.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, type, type)).
                      invokeExact((VarHandleTestMethodTypeString) null, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, type, type)).
                      invokeExact(Void.class, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, Class.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, Class.class, type)).
                      invokeExact(recv, Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, type, Class.class)).
                      invokeExact(recv, "foo", Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , type, type)).
                      invokeExact(0, "foo", "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, String.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, type, type, Class.class)).
                      invokeExact(recv, "foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              checkNPE(() -> { // null receiver
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, type, type)).
                      invokeExact((VarHandleTestMethodTypeString) null, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, type, type)).
                      invokeExact(Void.class, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, Class.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, Class.class, type)).
                      invokeExact(recv, Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, type, Class.class)).
                      invokeExact(recv, "foo", Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
-                 String x = (String) hs.get(am, methodType(String.class, int.class , String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, int.class , type, type)).
                      invokeExact(0, "foo", "foo");
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeString.class , String.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeString.class , type, type)).
                      invokeExact(recv, "foo", "foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class , String.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class , type, type)).
                      invokeExact(recv, "foo", "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, String.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, type, type, Class.class)).
                      invokeExact(recv, "foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              checkNPE(() -> { // null receiver
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, type)).
                      invokeExact((VarHandleTestMethodTypeString) null, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // value reference class
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, Class.class)).
                      invokeExact(recv, Void.class);
              });
              checkWMTE(() -> { // reciever primitive class
-                 String x = (String) hs.get(am, methodType(String.class, int.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, int.class, type)).
                      invokeExact(0, "foo");
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeString.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeString.class, type)).
                      invokeExact(recv, "foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeString.class, type)).
                      invokeExact(recv, "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, VarHandleTestMethodTypeString.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, VarHandleTestMethodTypeString.class, type)).
                      invokeExact(recv, "foo", Void.class);
              });
          }
  
  

@@ -1185,87 +1189,87 @@
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 hs.get(am, methodType(void.class, String.class, Class.class)).
+                 hs.get(am, methodType(void.class, type, Class.class)).
                      invokeExact("foo", Void.class);
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, type)).
                      invokeExact(Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, type, Class.class)).
                      invokeExact("foo", 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, String.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, type, type, Class.class)).
                      invokeExact("foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, type)).
                      invokeExact(Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 String x = (String) hs.get(am, methodType(String.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact("foo", Void.class);
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, String.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, type, type)).
                      invokeExact("foo", "foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type, type)).
                      invokeExact("foo", "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, String.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, type, type, Class.class)).
                      invokeExact("foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              hs.checkWMTEOrCCE(() -> { // value reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class)).
                      invokeExact(Void.class);
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, type)).
                      invokeExact("foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, type)).
                      invokeExact("foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, type, Class.class)).
                      invokeExact("foo", Void.class);
              });
          }
  
  

@@ -1859,23 +1863,23 @@
          Arrays.fill(array, "foo");
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class)).
                      invokeExact((String[]) null, 0);
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, int.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, int.class)).
                      invokeExact(Void.class, 0);
              });
              checkWMTE(() -> { // array primitive class
-                 String x = (String) hs.get(am, methodType(String.class, int.class, int.class)).
+                 String x = (String) hs.get(am, methodType(type, int.class, int.class)).
                      invokeExact(0, 0);
              });
              checkWMTE(() -> { // index reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, Class.class)).
                      invokeExact(array, Void.class);
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
                  Void x = (Void) hs.get(am, methodType(Void.class, String[].class, int.class)).

@@ -1885,39 +1889,39 @@
                  boolean x = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class)).
                      invokeExact(array, 0);
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].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, String[].class, int.class, String.class)).
+                 hs.get(am, methodType(void.class, String[].class, int.class, type)).
                      invokeExact((String[]) null, 0, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
-                 hs.get(am, methodType(void.class, Class.class, int.class, String.class)).
+                 hs.get(am, methodType(void.class, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // value reference class
                  hs.get(am, methodType(void.class, String[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
-                 hs.get(am, methodType(void.class, int.class, int.class, String.class)).
+                 hs.get(am, methodType(void.class, int.class, int.class, type)).
                      invokeExact(0, 0, "foo");
              });
              checkWMTE(() -> { // index reference class
-                 hs.get(am, methodType(void.class, String[].class, Class.class, String.class)).
+                 hs.get(am, methodType(void.class, String[].class, Class.class, type)).
                      invokeExact(array, Void.class, "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  hs.get(am, methodType(void.class)).

@@ -1929,128 +1933,128 @@
              });
          }
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, type, type)).
                      invokeExact((String[]) null, 0, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // receiver reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, type, type)).
                      invokeExact(Void.class, 0, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, Class.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, Class.class, type)).
                      invokeExact(array, 0, Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, "foo", Void.class);
              });
              checkWMTE(() -> { // receiver primitive class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, type, type)).
                      invokeExact(0, 0, "foo", "foo");
              });
              checkWMTE(() -> { // index reference class
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, Class.class, String.class, String.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, Class.class, type, type)).
                      invokeExact(array, Void.class, "foo", "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
                  boolean r = (boolean) hs.get(am, methodType(boolean.class)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, String.class, String.class, Class.class)).
+                 boolean r = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, type, type, Class.class)).
                      invokeExact(array, 0, "foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
              // Incorrect argument types
              checkNPE(() -> { // null receiver
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, type, type)).
                      invokeExact((String[]) null, 0, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, int.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, int.class, type, type)).
                      invokeExact(Void.class, 0, "foo", "foo");
              });
              hs.checkWMTEOrCCE(() -> { // expected reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, Class.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, Class.class, type)).
                      invokeExact(array, 0, Void.class, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // actual reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, "foo", Void.class);
              });
              checkWMTE(() -> { // array primitive class
-                 String x = (String) hs.get(am, methodType(String.class, int.class, int.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, int.class, int.class, type, type)).
                      invokeExact(0, 0, "foo", "foo");
              });
              checkWMTE(() -> { // index reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, Class.class, String.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, Class.class, type, type)).
                      invokeExact(array, Void.class, "foo", "foo");
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, String[].class, int.class, String.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, String[].class, int.class, type, type)).
                      invokeExact(array, 0, "foo", "foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, String.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, type, type)).
                      invokeExact(array, 0, "foo", "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, String.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, type, type, Class.class)).
                      invokeExact(array, 0, "foo", "foo", Void.class);
              });
          }
  
          for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
              // Incorrect argument types
              checkNPE(() -> { // null array
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, type)).
                      invokeExact((String[]) null, 0, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // array reference class
-                 String x = (String) hs.get(am, methodType(String.class, Class.class, int.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, Class.class, int.class, type)).
                      invokeExact(Void.class, 0, "foo");
              });
              hs.checkWMTEOrCCE(() -> { // value reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, Class.class)).
                      invokeExact(array, 0, Void.class);
              });
              checkWMTE(() -> { // array primitive class
-                 String x = (String) hs.get(am, methodType(String.class, int.class, int.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, int.class, int.class, type)).
                      invokeExact(0, 0, "foo");
              });
              checkWMTE(() -> { // index reference class
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, Class.class, String.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, Class.class, type)).
                      invokeExact(array, Void.class, "foo");
              });
              // Incorrect return type
              hs.checkWMTEOrCCE(() -> { // reference class
-                 Void r = (Void) hs.get(am, methodType(Void.class, String[].class, int.class, String.class)).
+                 Void r = (Void) hs.get(am, methodType(Void.class, String[].class, int.class, type)).
                      invokeExact(array, 0, "foo");
              });
              checkWMTE(() -> { // primitive class
-                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, String.class)).
+                 boolean x = (boolean) hs.get(am, methodType(boolean.class, String[].class, int.class, type)).
                      invokeExact(array, 0, "foo");
              });
              // Incorrect arity
              checkWMTE(() -> { // 0
-                 String x = (String) hs.get(am, methodType(String.class)).
+                 String x = (String) hs.get(am, methodType(type)).
                      invokeExact();
              });
              checkWMTE(() -> { // >
-                 String x = (String) hs.get(am, methodType(String.class, String[].class, int.class, String.class, Class.class)).
+                 String x = (String) hs.get(am, methodType(type, String[].class, int.class, type, Class.class)).
                      invokeExact(array, 0, "foo", Void.class);
              });
          }
  
  
< prev index next >