< prev index next >

test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java

Print this page

        

@@ -40,17 +40,17 @@
 import static org.testng.Assert.*;
 
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeChar extends VarHandleBaseTest {
-    static final char static_final_v = 'a';
+    static final char static_final_v = '\u0123';
 
-    static char static_v = 'a';
+    static char static_v = '\u0123';
 
-    final char final_v = 'a';
+    final char final_v = '\u0123';
 
-    char v = 'a';
+    char v = '\u0123';
 
     VarHandle vhFinalField;
 
     VarHandle vhField;
 

@@ -150,27 +150,27 @@
 
 
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, 'a');
+            vh.set(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, 'a');
+            vh.set(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 'a');
+            vh.set(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, 'a', Void.class);
+            vh.set(recv, '\u0123', Void.class);
         });
 
 
         // GetVolatile
         // Incorrect argument types

@@ -200,27 +200,27 @@
 
 
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, 'a');
+            vh.setVolatile(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, 'a');
+            vh.setVolatile(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 'a');
+            vh.setVolatile(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, 'a', Void.class);
+            vh.setVolatile(recv, '\u0123', Void.class);
         });
 
 
         // GetOpaque
         // Incorrect argument types

@@ -250,27 +250,27 @@
 
 
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, 'a');
+            vh.setOpaque(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, 'a');
+            vh.setOpaque(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 'a');
+            vh.setOpaque(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, 'a', Void.class);
+            vh.setOpaque(recv, '\u0123', Void.class);
         });
 
 
         // GetAcquire
         // Incorrect argument types

@@ -300,487 +300,1613 @@
 
 
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, 'a');
+            vh.setRelease(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, 'a');
+            vh.setRelease(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 'a');
+            vh.setRelease(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, 'a', Void.class);
+            vh.setRelease(recv, '\u0123', Void.class);
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeVolatile(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchangeVolatile(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeVolatile(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeVolatile(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchangeVolatile(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeVolatile();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeVolatileAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeAcquire(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchangeAcquire(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeRelease(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchangeRelease(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchangeRelease(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.getAndSet(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.getAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.getAndSet(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndSet(recv, '\u0123', Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.getAndAdd(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.getAndAdd(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.getAndAdd(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndAdd(recv, '\u0123', Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.addAndGet(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.addAndGet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.addAndGet(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.addAndGet(recv, '\u0123', Void.class);
+        });
+    }
+
+    static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeChar recv, Handles hs) throws Throwable {
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, Void.class)).
+                    invoke(null);
+            });
+            checkCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+                    invoke(Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class)).
+                    invoke(0);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void x = (Void) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class)).
+                    invoke(recv);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class)).
+                    invoke(recv);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invoke(recv, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                hs.get(am, methodType(void.class, Void.class, char.class)).
+                    invoke(null, '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                hs.get(am, methodType(void.class, Class.class, char.class)).
+                    invoke(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invoke(recv, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                hs.get(am, methodType(void.class, int.class, char.class)).
+                    invoke(0, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                hs.get(am, methodType(void.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
+                    invoke(recv, '\u0123', 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, Void.class, char.class, char.class)).
+                    invoke(null, '\u0123', '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, char.class, char.class)).
+                    invoke(Void.class, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, Class.class, char.class)).
+                    invoke(recv, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
+                    invoke(recv, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , char.class, char.class)).
+                    invoke(0, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class, char.class, Class.class)).
+                    invoke(recv, '\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, Void.class, char.class, char.class)).
+                    invoke(null, '\u0123', '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class, char.class)).
+                    invoke(Void.class, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class, char.class)).
+                    invoke(recv, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
+                    invoke(recv, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class , char.class, char.class)).
+                    invoke(0, '\u0123', '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class , char.class, char.class)).
+                    invoke(recv, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class , char.class, char.class)).
+                    invoke(recv, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class, char.class, Class.class)).
+                    invoke(recv, '\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, Void.class, char.class)).
+                    invoke(null, '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invoke(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invoke(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, char.class)).
+                    invoke(0, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, Void.class, char.class)).
+                    invoke(null, '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invoke(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invoke(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, char.class)).
+                    invoke(0, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invoke(recv, '\u0123', Void.class);
+            });
+        }
+    }
+
+
+    static void testStaticFieldWrongMethodType(VarHandle vh) throws Throwable {
+        // Get
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void x = (Void) vh.get();
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.get();
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // >
+            char x = (char) vh.get(Void.class);
+        });
+
+
+        // Set
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            vh.set(Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            vh.set();
+        });
+        checkWMTE(() -> { // >
+            vh.set('\u0123', Void.class);
+        });
+
+
+        // GetVolatile
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void x = (Void) vh.getVolatile();
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getVolatile();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getVolatile(Void.class);
+        });
+
+
+        // SetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            vh.setVolatile(Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            vh.setVolatile();
+        });
+        checkWMTE(() -> { // >
+            vh.setVolatile('\u0123', Void.class);
+        });
+
+
+        // GetOpaque
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void x = (Void) vh.getOpaque();
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getOpaque();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getOpaque(Void.class);
+        });
+
+
+        // SetOpaque
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            vh.setOpaque(Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            vh.setOpaque();
+        });
+        checkWMTE(() -> { // >
+            vh.setOpaque('\u0123', Void.class);
+        });
+
+
+        // GetAcquire
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void x = (Void) vh.getAcquire();
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAcquire(Void.class);
+        });
+
+
+        // SetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            vh.setRelease(Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            vh.setRelease();
+        });
+        checkWMTE(() -> { // >
+            vh.setRelease('\u0123', Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease('\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeVolatile(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeVolatile('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeVolatile('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeVolatile('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeVolatile();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeVolatile('\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeAcquire('\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeRelease('\u0123', '\u0123', Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndSet('\u0123', Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndAdd('\u0123', Void.class);
+        });
+
 
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.addAndGet('\u0123', Void.class);
+        });
     }
 
-    static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeChar recv, Handles hs) throws Throwable {
+    static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
+        int i = 0;
+
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
-            // Incorrect argument types
-            checkNPE(() -> { // null receiver
-                char x = (char) hs.get(am, methodType(char.class, Void.class)).
-                    invoke(null);
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void x = (Void) hs.get(am, methodType(Void.class)).
+                    invoke();
             });
-            checkCCE(() -> { // receiver reference class
-                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invoke();
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(Class.class)).
                     invoke(Void.class);
             });
-            checkWMTE(() -> { // receiver primitive class
-                char x = (char) hs.get(am, methodType(char.class, int.class)).
-                    invoke(0);
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
+            checkWMTE(() -> { // value reference class
+                hs.get(am, methodType(void.class, Class.class)).
+                    invoke(Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                hs.get(am, methodType(void.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                hs.get(am, methodType(void.class, char.class, Class.class)).
+                    invoke('\u0123', 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, char.class)).
+                    invoke(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char.class, Class.class)).
+                    invoke('\u0123', Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char.class, char.class, Class.class)).
+                    invoke('\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invoke(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invoke('\u0123', Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class)).
-                    invoke(recv);
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class, char.class)).
+                    invoke('\u0123', '\u0123');
             });
             checkWMTE(() -> { // primitive class
-                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class)).
-                    invoke(recv);
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class, char.class)).
+                    invoke('\u0123', '\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 char x = (char) hs.get(am, methodType(char.class)).
                     invoke();
             });
             checkWMTE(() -> { // >
-                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
-                    invoke(recv, Void.class);
+                char x = (char) hs.get(am, methodType(char.class, char.class, char.class, Class.class)).
+                    invoke('\u0123', '\u0123', Void.class);
             });
         }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             // Incorrect argument types
-            checkNPE(() -> { // null receiver
-                hs.get(am, methodType(void.class, Void.class, char.class)).
-                    invoke(null, 'a');
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+                    invoke(Void.class);
             });
-            checkCCE(() -> { // receiver reference class
-                hs.get(am, methodType(void.class, Class.class, char.class)).
-                    invoke(Void.class, 'a');
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class)).
+                    invoke('\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class)).
+                    invoke('\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
             });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invoke('\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
             checkWMTE(() -> { // value reference class
-                hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, Class.class)).
-                    invoke(recv, Void.class);
+                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+                    invoke(Void.class);
             });
-            checkWMTE(() -> { // receiver primitive class
-                hs.get(am, methodType(void.class, int.class, char.class)).
-                    invoke(0, 'a');
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class)).
+                    invoke('\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class)).
+                    invoke('\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
-                hs.get(am, methodType(void.class)).
+                char x = (char) hs.get(am, methodType(char.class)).
                     invoke();
             });
             checkWMTE(() -> { // >
-                hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
-                    invoke(recv, 'a', Void.class);
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invoke('\u0123', Void.class);
             });
         }
-
-
     }
 
 
-    static void testStaticFieldWrongMethodType(VarHandle vh) throws Throwable {
+    static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
+        char[] array = new char[10];
+        Arrays.fill(array, '\u0123');
+
         // Get
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.get(null, 0);
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.get(Void.class, 0);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.get(0, 0);
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.get(array, Void.class);
+        });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.get();
+            Void x = (Void) vh.get(array, 0);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.get();
+            boolean x = (boolean) vh.get(array, 0);
         });
         // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.get();
+        });
         checkWMTE(() -> { // >
-            char x = (char) vh.get(Void.class);
+            char x = (char) vh.get(array, 0, Void.class);
         });
 
 
         // Set
         // Incorrect argument types
+        checkNPE(() -> { // null array
+            vh.set(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            vh.set(Void.class, 0, '\u0123');
+        });
         checkWMTE(() -> { // value reference class
-            vh.set(Void.class);
+            vh.set(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            vh.set(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            vh.set(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set('a', Void.class);
+            vh.set(array, 0, '\u0123', Void.class);
         });
 
 
         // GetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.getVolatile(null, 0);
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.getVolatile(Void.class, 0);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.getVolatile(0, 0);
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.getVolatile(array, Void.class);
+        });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getVolatile();
+            Void x = (Void) vh.getVolatile(array, 0);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getVolatile();
+            boolean x = (boolean) vh.getVolatile(array, 0);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getVolatile();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getVolatile(Void.class);
+            char x = (char) vh.getVolatile(array, 0, Void.class);
         });
 
 
         // SetVolatile
         // Incorrect argument types
+        checkNPE(() -> { // null array
+            vh.setVolatile(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            vh.setVolatile(Void.class, 0, '\u0123');
+        });
         checkWMTE(() -> { // value reference class
-            vh.setVolatile(Void.class);
+            vh.setVolatile(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            vh.setVolatile(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            vh.setVolatile(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile('a', Void.class);
+            vh.setVolatile(array, 0, '\u0123', Void.class);
         });
 
 
         // GetOpaque
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.getOpaque(null, 0);
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.getOpaque(Void.class, 0);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.getOpaque(0, 0);
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.getOpaque(array, Void.class);
+        });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getOpaque();
+            Void x = (Void) vh.getOpaque(array, 0);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getOpaque();
+            boolean x = (boolean) vh.getOpaque(array, 0);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getOpaque();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getOpaque(Void.class);
+            char x = (char) vh.getOpaque(array, 0, Void.class);
         });
 
 
         // SetOpaque
         // Incorrect argument types
+        checkNPE(() -> { // null array
+            vh.setOpaque(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            vh.setOpaque(Void.class, 0, '\u0123');
+        });
         checkWMTE(() -> { // value reference class
-            vh.setOpaque(Void.class);
+            vh.setOpaque(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            vh.setOpaque(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            vh.setOpaque(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque('a', Void.class);
+            vh.setOpaque(array, 0, '\u0123', Void.class);
         });
 
 
         // GetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.getAcquire(null, 0);
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.getAcquire(Void.class, 0);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.getAcquire(0, 0);
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.getAcquire(array, Void.class);
+        });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getAcquire();
+            Void x = (Void) vh.getAcquire(array, 0);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAcquire(array, 0);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAcquire(array, 0, Void.class);
+        });
+
+
+        // SetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            vh.setRelease(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            vh.setRelease(Void.class, 0, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            vh.setRelease(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            vh.setRelease(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            vh.setRelease(array, Void.class, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            vh.setRelease();
+        });
+        checkWMTE(() -> { // >
+            vh.setRelease(array, 0, '\u0123', Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, '\u0123', '\u0123');
         });
-        checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAcquire();
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getAcquire(Void.class);
+            boolean r = vh.compareAndSet(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // SetRelease
+        // WeakCompareAndSet
         // Incorrect argument types
-        checkWMTE(() -> { // value reference class
-            vh.setRelease(Void.class);
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            vh.setRelease();
+            boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            vh.setRelease('a', Void.class);
+            boolean r = vh.weakCompareAndSet(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-
-    }
-
-    static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
-        int i = 0;
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
-            // Incorrect return type
-            checkWMTE(() -> { // reference class
-                Void x = (Void) hs.get(am, methodType(Void.class)).
-                    invoke();
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, '\u0123', '\u0123');
             });
-            checkWMTE(() -> { // primitive class
-                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
-                    invoke();
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, '\u0123', '\u0123');
             });
-            // Incorrect arity
-            checkWMTE(() -> { // >
-                char x = (char) hs.get(am, methodType(Class.class)).
-                    invoke(Void.class);
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, '\u0123');
             });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
-            checkWMTE(() -> { // value reference class
-                hs.get(am, methodType(void.class, Class.class)).
-                    invoke(Void.class);
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, '\u0123', '\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
-                hs.get(am, methodType(void.class)).
-                    invoke();
+            boolean r = vh.weakCompareAndSetVolatile();
             });
             checkWMTE(() -> { // >
-                hs.get(am, methodType(void.class, char.class, Class.class)).
-                    invoke('a', Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', '\u0123', Void.class);
             });
-        }
-
-    }
 
 
-    static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
-        char[] array = new char[10];
-        Arrays.fill(array, 'a');
-
-        // Get
+        // WeakCompareAndSetAcquire
         // Incorrect argument types
-        checkNPE(() -> { // null array
-            char x = (char) vh.get(null, 0);
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, '\u0123', '\u0123');
         });
-        checkCCE(() -> { // array reference class
-            char x = (char) vh.get(Void.class, 0);
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, '\u0123', '\u0123');
         });
-        checkWMTE(() -> { // array primitive class
-            char x = (char) vh.get(0, 0);
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, '\u0123');
         });
-        checkWMTE(() -> { // index reference class
-            char x = (char) vh.get(array, Void.class);
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, '\u0123', Void.class);
         });
-        // Incorrect return type
-        checkWMTE(() -> { // reference class
-            Void x = (Void) vh.get(array, 0);
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, '\u0123', '\u0123');
         });
-        checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.get(array, 0);
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            char x = (char) vh.get();
+            boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.get(array, 0, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // Set
+        // WeakCompareAndSetRelease
         // Incorrect argument types
-        checkNPE(() -> { // null array
-            vh.set(null, 0, 'a');
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, '\u0123', '\u0123');
         });
-        checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, 'a');
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, '\u0123', '\u0123');
         });
-        checkWMTE(() -> { // value reference class
-            vh.set(array, 0, Void.class);
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, '\u0123', Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, 'a');
+            boolean r = vh.weakCompareAndSetRelease(0, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, 'a');
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            vh.set();
+            boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, 'a', Void.class);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // GetVolatile
+        // CompareAndExchangeVolatile
         // Incorrect argument types
-        checkNPE(() -> { // null array
-            char x = (char) vh.getVolatile(null, 0);
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeVolatile(null, 0, '\u0123', '\u0123');
         });
         checkCCE(() -> { // array reference class
-            char x = (char) vh.getVolatile(Void.class, 0);
+            char x = (char) vh.compareAndExchangeVolatile(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeVolatile(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeVolatile(array, 0, '\u0123', Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            char x = (char) vh.getVolatile(0, 0);
+            char x = (char) vh.compareAndExchangeVolatile(0, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            char x = (char) vh.getVolatile(array, Void.class);
+            char x = (char) vh.compareAndExchangeVolatile(array, Void.class, '\u0123', '\u0123');
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getVolatile(array, 0);
+            Void r = (Void) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getVolatile(array, 0);
+            boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            char x = (char) vh.getVolatile();
+            char x = (char) vh.compareAndExchangeVolatile();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getVolatile(array, 0, Void.class);
+            char x = (char) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // SetVolatile
+        // CompareAndExchangeAcquire
         // Incorrect argument types
-        checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, 'a');
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeAcquire(null, 0, '\u0123', '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, 'a');
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, 0, '\u0123', '\u0123');
         });
-        checkWMTE(() -> { // value reference class
-            vh.setVolatile(array, 0, Void.class);
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, Void.class, '\u0123');
         });
-        checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, 'a');
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.compareAndExchangeAcquire(0, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, 'a');
+            char x = (char) vh.compareAndExchangeAcquire(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            vh.setVolatile();
+            char x = (char) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, 'a', Void.class);
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // GetOpaque
+        // CompareAndExchangeRelease
         // Incorrect argument types
-        checkNPE(() -> { // null array
-            char x = (char) vh.getOpaque(null, 0);
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeRelease(null, 0, '\u0123', '\u0123');
         });
         checkCCE(() -> { // array reference class
-            char x = (char) vh.getOpaque(Void.class, 0);
+            char x = (char) vh.compareAndExchangeRelease(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease(array, 0, '\u0123', Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            char x = (char) vh.getOpaque(0, 0);
+            char x = (char) vh.compareAndExchangeRelease(0, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            char x = (char) vh.getOpaque(array, Void.class);
+            char x = (char) vh.compareAndExchangeRelease(array, Void.class, '\u0123', '\u0123');
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getOpaque(array, 0);
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123');
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getOpaque(array, 0);
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            char x = (char) vh.getOpaque();
+            char x = (char) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getOpaque(array, 0, Void.class);
+            char x = (char) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
-        // SetOpaque
+        // GetAndSet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, 'a');
+            char x = (char) vh.getAndSet(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, 'a');
+            char x = (char) vh.getAndSet(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
-            vh.setOpaque(array, 0, Void.class);
+            char x = (char) vh.getAndSet(array, 0, Void.class);
         });
-        checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, 'a');
+        checkWMTE(() -> { // reciarrayever primitive class
+            char x = (char) vh.getAndSet(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, 'a');
+            char x = (char) vh.getAndSet(array, Void.class, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            vh.setOpaque();
+            char x = (char) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, 'a', Void.class);
+            char x = (char) vh.getAndSet(array, 0, '\u0123', Void.class);
         });
 
-
-        // GetAcquire
+        // GetAndAdd
         // Incorrect argument types
         checkNPE(() -> { // null array
-            char x = (char) vh.getAcquire(null, 0);
+            char x = (char) vh.getAndAdd(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            char x = (char) vh.getAcquire(Void.class, 0);
+            char x = (char) vh.getAndAdd(Void.class, 0, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(array, 0, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            char x = (char) vh.getAcquire(0, 0);
+            char x = (char) vh.getAndAdd(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            char x = (char) vh.getAcquire(array, Void.class);
+            char x = (char) vh.getAndAdd(array, Void.class, '\u0123');
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void x = (Void) vh.getAcquire(array, 0);
+            Void r = (Void) vh.getAndAdd(array, 0, '\u0123');
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAcquire(array, 0);
+            boolean x = (boolean) vh.getAndAdd(array, 0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            char x = (char) vh.getAcquire();
+            char x = (char) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            char x = (char) vh.getAcquire(array, 0, Void.class);
+            char x = (char) vh.getAndAdd(array, 0, '\u0123', Void.class);
         });
 
 
-        // SetRelease
+        // AddAndGet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, 'a');
+            char x = (char) vh.addAndGet(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, 'a');
+            char x = (char) vh.addAndGet(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
-            vh.setRelease(array, 0, Void.class);
+            char x = (char) vh.addAndGet(array, 0, Void.class);
         });
-        checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, 'a');
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.addAndGet(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, 'a');
+            char x = (char) vh.addAndGet(array, Void.class, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            vh.setRelease();
+            char x = (char) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, 'a', Void.class);
+            char x = (char) vh.addAndGet(array, 0, '\u0123', Void.class);
         });
-
-
-
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         char[] array = new char[10];
-        Arrays.fill(array, 'a');
+        Arrays.fill(array, '\u0123');
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
                 char x = (char) hs.get(am, methodType(char.class, Void.class, int.class)).

@@ -820,37 +1946,202 @@
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, Void.class, int.class, char.class)).
-                    invoke(null, 0, 'a');
+                    invoke(null, 0, '\u0123');
             });
             checkCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, char.class)).
-                    invoke(Void.class, 0, 'a');
+                    invoke(Void.class, 0, '\u0123');
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
                     invoke(array, 0, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, char.class)).
-                    invoke(0, 0, 'a');
+                    invoke(0, 0, '\u0123');
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, char[].class, Class.class, char.class)).
-                    invoke(array, Void.class, 'a');
+                    invoke(array, Void.class, '\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
                 hs.get(am, methodType(void.class)).
                     invoke();
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
-                    invoke(array, 0, 'a', Void.class);
+                    invoke(array, 0, '\u0123', 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, Void.class, int.class, char.class, char.class)).
+                    invoke(null, 0, '\u0123', '\u0123');
+            });
+            checkCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, char.class, char.class)).
+                    invoke(Void.class, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, Class.class, char.class)).
+                    invoke(array, 0, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, char.class, char.class)).
+                    invoke(0, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, Class.class, char.class, char.class)).
+                    invoke(array, Void.class, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, Void.class, int.class, char.class, char.class)).
+                    invoke(null, 0, '\u0123', '\u0123');
+            });
+            checkCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class, char.class)).
+                    invoke(Void.class, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class, char.class)).
+                    invoke(array, 0, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class, char.class)).
+                    invoke(0, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class, char.class)).
+                    invoke(array, Void.class, '\u0123', '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class, char.class)).
+                    invoke(array, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, char.class)).
+                    invoke(array, 0, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                char x = (char) hs.get(am, methodType(char.class, Void.class, int.class, char.class)).
+                    invoke(null, 0, '\u0123');
+            });
+            checkCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class)).
+                    invoke(Void.class, 0, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
+                    invoke(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class)).
+                    invoke(0, 0, '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class)).
+                    invoke(array, Void.class, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class)).
+                    invoke(array, 0, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class)).
+                    invoke(array, 0, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                char x = (char) hs.get(am, methodType(char.class, Void.class, int.class, char.class)).
+                    invoke(null, 0, '\u0123');
+            });
+            checkCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class)).
+                    invoke(Void.class, 0, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
+                    invoke(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class)).
+                    invoke(0, 0, '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class)).
+                    invoke(array, Void.class, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class)).
+                    invoke(array, 0, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class)).
+                    invoke(array, 0, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invoke();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invoke(array, 0, '\u0123', Void.class);
+            });
+        }
     }
 }
 
< prev index next >