< prev index next >
test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java
Print this page
@@ -40,17 +40,17 @@
import static org.testng.Assert.*;
import static java.lang.invoke.MethodType.*;
public class VarHandleTestMethodTypeInt extends VarHandleBaseTest {
- static final int static_final_v = 1;
+ static final int static_final_v = 0x01234567;
- static int static_v = 1;
+ static int static_v = 0x01234567;
- final int final_v = 1;
+ final int final_v = 0x01234567;
- int v = 1;
+ int v = 0x01234567;
VarHandle vhFinalField;
VarHandle vhField;
@@ -150,27 +150,27 @@
// Set
// Incorrect argument types
checkNPE(() -> { // null receiver
- vh.set(null, 1);
+ vh.set(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- vh.set(Void.class, 1);
+ vh.set(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.set(recv, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.set(0, 1);
+ vh.set(0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.set();
});
checkWMTE(() -> { // >
- vh.set(recv, 1, Void.class);
+ vh.set(recv, 0x01234567, Void.class);
});
// GetVolatile
// Incorrect argument types
@@ -200,27 +200,27 @@
// SetVolatile
// Incorrect argument types
checkNPE(() -> { // null receiver
- vh.setVolatile(null, 1);
+ vh.setVolatile(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- vh.setVolatile(Void.class, 1);
+ vh.setVolatile(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setVolatile(recv, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setVolatile(0, 1);
+ vh.setVolatile(0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setVolatile();
});
checkWMTE(() -> { // >
- vh.setVolatile(recv, 1, Void.class);
+ vh.setVolatile(recv, 0x01234567, Void.class);
});
// GetOpaque
// Incorrect argument types
@@ -250,27 +250,27 @@
// SetOpaque
// Incorrect argument types
checkNPE(() -> { // null receiver
- vh.setOpaque(null, 1);
+ vh.setOpaque(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- vh.setOpaque(Void.class, 1);
+ vh.setOpaque(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setOpaque(recv, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setOpaque(0, 1);
+ vh.setOpaque(0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setOpaque();
});
checkWMTE(() -> { // >
- vh.setOpaque(recv, 1, Void.class);
+ vh.setOpaque(recv, 0x01234567, Void.class);
});
// GetAcquire
// Incorrect argument types
@@ -300,345 +300,345 @@
// SetRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- vh.setRelease(null, 1);
+ vh.setRelease(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- vh.setRelease(Void.class, 1);
+ vh.setRelease(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setRelease(recv, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setRelease(0, 1);
+ vh.setRelease(0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setRelease();
});
checkWMTE(() -> { // >
- vh.setRelease(recv, 1, Void.class);
+ vh.setRelease(recv, 0x01234567, Void.class);
});
// CompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.compareAndSet(null, 1, 1);
+ boolean r = vh.compareAndSet(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.compareAndSet(Void.class, 1, 1);
+ boolean r = vh.compareAndSet(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.compareAndSet(recv, Void.class, 1);
+ boolean r = vh.compareAndSet(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.compareAndSet(recv, 1, Void.class);
+ boolean r = vh.compareAndSet(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.compareAndSet(0, 1, 1);
+ boolean r = vh.compareAndSet(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.compareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.compareAndSet(recv, 1, 1, Void.class);
+ boolean r = vh.compareAndSet(recv, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSet(null, 1, 1);
+ boolean r = vh.weakCompareAndSet(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSet(Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSet(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSet(recv, Void.class, 1);
+ boolean r = vh.weakCompareAndSet(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSet(recv, 1, Void.class);
+ boolean r = vh.weakCompareAndSet(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSet(0, 1, 1);
+ boolean r = vh.weakCompareAndSet(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSet(recv, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSet(recv, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetVolatile
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1);
+ boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, 1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetVolatile();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetAcquire(null, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetAcquire(Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 1);
+ boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetAcquire(recv, 1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetAcquire(0, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetAcquire();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetAcquire(recv, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(recv, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetRelease(null, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetRelease(Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 1);
+ boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetRelease(recv, 1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetRelease(0, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetRelease();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetRelease(recv, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(recv, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeVolatile
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeVolatile(null, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.compareAndExchangeVolatile(Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeVolatile(recv, Void.class, 1);
+ int x = (int) vh.compareAndExchangeVolatile(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeVolatile(recv, 1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.compareAndExchangeVolatile(0, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(0, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeVolatile(recv, 1, 1);
+ Void r = (Void) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeVolatile(recv, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeVolatileAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeAcquire(null, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.compareAndExchangeAcquire(Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeAcquire(recv, Void.class, 1);
+ int x = (int) vh.compareAndExchangeAcquire(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeAcquire(recv, 1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.compareAndExchangeAcquire(0, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(0, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeAcquire(recv, 1, 1);
+ Void r = (Void) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeAcquire();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeAcquire(recv, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeRelease(null, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.compareAndExchangeRelease(Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeRelease(recv, Void.class, 1);
+ int x = (int) vh.compareAndExchangeRelease(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeRelease(recv, 1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.compareAndExchangeRelease(0, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(0, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeRelease(recv, 1, 1);
+ Void r = (Void) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeRelease(recv, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeRelease();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeRelease(recv, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567, Void.class);
});
// GetAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.getAndSet(null, 1);
+ int x = (int) vh.getAndSet(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.getAndSet(Void.class, 1);
+ int x = (int) vh.getAndSet(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndSet(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.getAndSet(0, 1);
+ int x = (int) vh.getAndSet(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndSet(recv, 1);
+ Void r = (Void) vh.getAndSet(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndSet(recv, 1);
+ boolean x = (boolean) vh.getAndSet(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndSet();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndSet(recv, 1, Void.class);
+ int x = (int) vh.getAndSet(recv, 0x01234567, Void.class);
});
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.getAndAdd(null, 1);
+ int x = (int) vh.getAndAdd(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.getAndAdd(Void.class, 1);
+ int x = (int) vh.getAndAdd(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndAdd(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.getAndAdd(0, 1);
+ int x = (int) vh.getAndAdd(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndAdd(recv, 1);
+ Void r = (Void) vh.getAndAdd(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndAdd(recv, 1);
+ boolean x = (boolean) vh.getAndAdd(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndAdd();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndAdd(recv, 1, Void.class);
+ int x = (int) vh.getAndAdd(recv, 0x01234567, Void.class);
});
// AddAndGet
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.addAndGet(null, 1);
+ int x = (int) vh.addAndGet(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.addAndGet(Void.class, 1);
+ int x = (int) vh.addAndGet(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.addAndGet(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.addAndGet(0, 1);
+ int x = (int) vh.addAndGet(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, 1);
+ Void r = (Void) vh.addAndGet(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, 1);
+ boolean x = (boolean) vh.addAndGet(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.addAndGet();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(recv, 1, Void.class);
+ int x = (int) vh.addAndGet(recv, 0x01234567, Void.class);
});
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeInt recv, Handles hs) throws Throwable {
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
@@ -677,180 +677,180 @@
for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
// Incorrect argument types
checkNPE(() -> { // null receiver
hs.get(am, methodType(void.class, Void.class, int.class)).
- invoke(null, 1);
+ invoke(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
hs.get(am, methodType(void.class, Class.class, int.class)).
- invoke(Void.class, 1);
+ invoke(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, Class.class)).
invoke(recv, Void.class);
});
checkWMTE(() -> { // receiver primitive class
hs.get(am, methodType(void.class, int.class, int.class)).
- invoke(0, 1);
+ invoke(0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
hs.get(am, methodType(void.class)).
invoke();
});
checkWMTE(() -> { // >
hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
- invoke(recv, 1, Void.class);
+ invoke(recv, 0x01234567, 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, int.class)).
- invoke(null, 1, 1);
+ invoke(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class)).
- invoke(Void.class, 1, 1);
+ invoke(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
- invoke(recv, Void.class, 1);
+ invoke(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
- invoke(recv, 1, Void.class);
+ invoke(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , int.class, int.class)).
- invoke(0, 1, 1);
+ invoke(0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = (boolean) hs.get(am, methodType(boolean.class)).
invoke();
});
checkWMTE(() -> { // >
boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
- invoke(recv, 1, 1, Void.class);
+ invoke(recv, 0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
checkNPE(() -> { // null receiver
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
- invoke(null, 1, 1);
+ invoke(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
- invoke(Void.class, 1, 1);
+ invoke(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
- invoke(recv, Void.class, 1);
+ invoke(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
- invoke(recv, 1, Void.class);
+ invoke(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // reciever primitive class
int x = (int) hs.get(am, methodType(int.class, int.class , int.class, int.class)).
- invoke(0, 1, 1);
+ invoke(0, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
- invoke(recv, 1, 1);
+ invoke(recv, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
- invoke(recv, 1, 1);
+ invoke(recv, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
- invoke(recv, 1, 1, Void.class);
+ invoke(recv, 0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
checkNPE(() -> { // null receiver
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
- invoke(null, 1);
+ invoke(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
- invoke(Void.class, 1);
+ invoke(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
invoke(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
- invoke(0, 1);
+ invoke(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1);
+ invoke(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1);
+ invoke(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1, Void.class);
+ invoke(recv, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
checkNPE(() -> { // null receiver
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
- invoke(null, 1);
+ invoke(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
- invoke(Void.class, 1);
+ invoke(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
invoke(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
- invoke(0, 1);
+ invoke(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1);
+ invoke(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1);
+ invoke(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
- invoke(recv, 1, Void.class);
+ invoke(recv, 0x01234567, Void.class);
});
}
}
@@ -877,11 +877,11 @@
// Incorrect arity
checkWMTE(() -> { // 0
vh.set();
});
checkWMTE(() -> { // >
- vh.set(1, Void.class);
+ vh.set(0x01234567, Void.class);
});
// GetVolatile
// Incorrect return type
@@ -904,11 +904,11 @@
// Incorrect arity
checkWMTE(() -> { // 0
vh.setVolatile();
});
checkWMTE(() -> { // >
- vh.setVolatile(1, Void.class);
+ vh.setVolatile(0x01234567, Void.class);
});
// GetOpaque
// Incorrect return type
@@ -931,11 +931,11 @@
// Incorrect arity
checkWMTE(() -> { // 0
vh.setOpaque();
});
checkWMTE(() -> { // >
- vh.setOpaque(1, Void.class);
+ vh.setOpaque(0x01234567, Void.class);
});
// GetAcquire
// Incorrect return type
@@ -958,230 +958,230 @@
// Incorrect arity
checkWMTE(() -> { // 0
vh.setRelease();
});
checkWMTE(() -> { // >
- vh.setRelease(1, Void.class);
+ vh.setRelease(0x01234567, Void.class);
});
// CompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- boolean r = vh.compareAndSet(Void.class, 1);
+ boolean r = vh.compareAndSet(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.compareAndSet(1, Void.class);
+ boolean r = vh.compareAndSet(0x01234567, Void.class);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.compareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.compareAndSet(1, 1, Void.class);
+ boolean r = vh.compareAndSet(0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSet(Void.class, 1);
+ boolean r = vh.weakCompareAndSet(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSet(1, Void.class);
+ boolean r = vh.weakCompareAndSet(0x01234567, Void.class);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSet(1, 1, Void.class);
+ boolean r = vh.weakCompareAndSet(0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetVolatile
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1);
+ boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(0x01234567, Void.class);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetVolatile();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetAcquire(Void.class, 1);
+ boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetAcquire(1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(0x01234567, Void.class);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetAcquire();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetAcquire(1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetRelease
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetRelease(Void.class, 1);
+ boolean r = vh.weakCompareAndSetRelease(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetRelease(1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(0x01234567, Void.class);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetRelease();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetRelease(1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeVolatile
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeVolatile(Void.class, 1);
+ int x = (int) vh.compareAndExchangeVolatile(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeVolatile(1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(0x01234567, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeVolatile(1, 1);
+ Void r = (Void) vh.compareAndExchangeVolatile(0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeVolatile(1, 1);
+ boolean x = (boolean) vh.compareAndExchangeVolatile(0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeVolatile(1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeAcquire(Void.class, 1);
+ int x = (int) vh.compareAndExchangeAcquire(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeAcquire(1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(0x01234567, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeAcquire(1, 1);
+ Void r = (Void) vh.compareAndExchangeAcquire(0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeAcquire(1, 1);
+ boolean x = (boolean) vh.compareAndExchangeAcquire(0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeAcquire();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeAcquire(1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeRelease
// Incorrect argument types
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeRelease(Void.class, 1);
+ int x = (int) vh.compareAndExchangeRelease(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeRelease(1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(0x01234567, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeRelease(1, 1);
+ Void r = (Void) vh.compareAndExchangeRelease(0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeRelease(1, 1);
+ boolean x = (boolean) vh.compareAndExchangeRelease(0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeRelease();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeRelease(1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(0x01234567, 0x01234567, Void.class);
});
// GetAndSet
// Incorrect argument types
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndSet(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndSet(1);
+ Void r = (Void) vh.getAndSet(0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndSet(1);
+ boolean x = (boolean) vh.getAndSet(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndSet();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndSet(1, Void.class);
+ int x = (int) vh.getAndSet(0x01234567, Void.class);
});
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndAdd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndAdd(1);
+ Void r = (Void) vh.getAndAdd(0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndAdd(1);
+ boolean x = (boolean) vh.getAndAdd(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndAdd();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndAdd(1, Void.class);
+ int x = (int) vh.getAndAdd(0x01234567, Void.class);
});
// AddAndGet
// Incorrect argument types
checkWMTE(() -> { // value reference class
int x = (int) vh.addAndGet(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(1);
+ Void r = (Void) vh.addAndGet(0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(1);
+ boolean x = (boolean) vh.addAndGet(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.addAndGet();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(1, Void.class);
+ int x = (int) vh.addAndGet(0x01234567, Void.class);
});
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
int i = 0;
@@ -1213,61 +1213,61 @@
hs.get(am, methodType(void.class)).
invoke();
});
checkWMTE(() -> { // >
hs.get(am, methodType(void.class, int.class, Class.class)).
- invoke(1, Void.class);
+ invoke(0x01234567, 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, int.class)).
- invoke(Void.class, 1);
+ invoke(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, Class.class)).
- invoke(1, Void.class);
+ invoke(0x01234567, 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, int.class, int.class, Class.class)).
- invoke(1, 1, Void.class);
+ invoke(0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
// Incorrect argument types
checkWMTE(() -> { // expected reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
- invoke(Void.class, 1);
+ invoke(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
- invoke(1, Void.class);
+ invoke(0x01234567, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int.class, int.class)).
- invoke(1, 1);
+ invoke(0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class)).
- invoke(1, 1);
+ invoke(0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int.class, int.class, Class.class)).
- invoke(1, 1, Void.class);
+ invoke(0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
// Incorrect argument types
@@ -1276,24 +1276,24 @@
invoke(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
- invoke(1);
+ invoke(0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
- invoke(1);
+ invoke(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
- invoke(1, Void.class);
+ invoke(0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
// Incorrect argument types
@@ -1302,32 +1302,32 @@
invoke(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
- invoke(1);
+ invoke(0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
- invoke(1);
+ invoke(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
- invoke(1, Void.class);
+ invoke(0x01234567, Void.class);
});
}
}
static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
int[] array = new int[10];
- Arrays.fill(array, 1);
+ Arrays.fill(array, 0x01234567);
// Get
// Incorrect argument types
checkNPE(() -> { // null array
int x = (int) vh.get(null, 0);
@@ -1358,30 +1358,30 @@
// Set
// Incorrect argument types
checkNPE(() -> { // null array
- vh.set(null, 0, 1);
+ vh.set(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- vh.set(Void.class, 0, 1);
+ vh.set(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.set(array, 0, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.set(0, 0, 1);
+ vh.set(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- vh.set(array, Void.class, 1);
+ vh.set(array, Void.class, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.set();
});
checkWMTE(() -> { // >
- vh.set(array, 0, 1, Void.class);
+ vh.set(array, 0, 0x01234567, Void.class);
});
// GetVolatile
// Incorrect argument types
@@ -1414,30 +1414,30 @@
// SetVolatile
// Incorrect argument types
checkNPE(() -> { // null array
- vh.setVolatile(null, 0, 1);
+ vh.setVolatile(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- vh.setVolatile(Void.class, 0, 1);
+ vh.setVolatile(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setVolatile(array, 0, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setVolatile(0, 0, 1);
+ vh.setVolatile(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- vh.setVolatile(array, Void.class, 1);
+ vh.setVolatile(array, Void.class, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setVolatile();
});
checkWMTE(() -> { // >
- vh.setVolatile(array, 0, 1, Void.class);
+ vh.setVolatile(array, 0, 0x01234567, Void.class);
});
// GetOpaque
// Incorrect argument types
@@ -1470,30 +1470,30 @@
// SetOpaque
// Incorrect argument types
checkNPE(() -> { // null array
- vh.setOpaque(null, 0, 1);
+ vh.setOpaque(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- vh.setOpaque(Void.class, 0, 1);
+ vh.setOpaque(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setOpaque(array, 0, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setOpaque(0, 0, 1);
+ vh.setOpaque(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- vh.setOpaque(array, Void.class, 1);
+ vh.setOpaque(array, Void.class, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setOpaque();
});
checkWMTE(() -> { // >
- vh.setOpaque(array, 0, 1, Void.class);
+ vh.setOpaque(array, 0, 0x01234567, Void.class);
});
// GetAcquire
// Incorrect argument types
@@ -1526,387 +1526,387 @@
// SetRelease
// Incorrect argument types
checkNPE(() -> { // null array
- vh.setRelease(null, 0, 1);
+ vh.setRelease(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- vh.setRelease(Void.class, 0, 1);
+ vh.setRelease(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
vh.setRelease(array, 0, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- vh.setRelease(0, 0, 1);
+ vh.setRelease(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- vh.setRelease(array, Void.class, 1);
+ vh.setRelease(array, Void.class, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
vh.setRelease();
});
checkWMTE(() -> { // >
- vh.setRelease(array, 0, 1, Void.class);
+ vh.setRelease(array, 0, 0x01234567, Void.class);
});
// CompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.compareAndSet(null, 0, 1, 1);
+ boolean r = vh.compareAndSet(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.compareAndSet(Void.class, 0, 1, 1);
+ boolean r = vh.compareAndSet(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.compareAndSet(array, 0, Void.class, 1);
+ boolean r = vh.compareAndSet(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.compareAndSet(array, 0, 1, Void.class);
+ boolean r = vh.compareAndSet(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.compareAndSet(0, 0, 1, 1);
+ boolean r = vh.compareAndSet(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- boolean r = vh.compareAndSet(array, Void.class, 1, 1);
+ boolean r = vh.compareAndSet(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.compareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.compareAndSet(array, 0, 1, 1, Void.class);
+ boolean r = vh.compareAndSet(array, 0, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSet(null, 0, 1, 1);
+ boolean r = vh.weakCompareAndSet(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSet(Void.class, 0, 1, 1);
+ boolean r = vh.weakCompareAndSet(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSet(array, 0, Void.class, 1);
+ boolean r = vh.weakCompareAndSet(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSet(array, 0, 1, Void.class);
+ boolean r = vh.weakCompareAndSet(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSet(0, 0, 1, 1);
+ boolean r = vh.weakCompareAndSet(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSet(array, Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSet(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSet();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSet(array, 0, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSet(array, 0, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetVolatile
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1);
+ boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetVolatile();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetAcquire(null, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 1);
+ boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetAcquire(array, 0, 1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetAcquire(0, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetAcquire();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetAcquire(array, 0, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x01234567, 0x01234567, Void.class);
});
// WeakCompareAndSetRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetRelease(null, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 1);
+ boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetRelease(array, 0, 1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetRelease(0, 0, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetRelease(array, Void.class, 1, 1);
+ boolean r = vh.weakCompareAndSetRelease(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = vh.weakCompareAndSetRelease();
});
checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetRelease(array, 0, 1, 1, Void.class);
+ boolean r = vh.weakCompareAndSetRelease(array, 0, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeVolatile
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeVolatile(null, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.compareAndExchangeVolatile(Void.class, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeVolatile(array, 0, Void.class, 1);
+ int x = (int) vh.compareAndExchangeVolatile(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeVolatile(array, 0, 1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.compareAndExchangeVolatile(0, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.compareAndExchangeVolatile(array, Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeVolatile(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 1, 1);
+ Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeVolatile(array, 0, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeAcquire(null, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.compareAndExchangeAcquire(Void.class, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeAcquire(array, 0, Void.class, 1);
+ int x = (int) vh.compareAndExchangeAcquire(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeAcquire(array, 0, 1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.compareAndExchangeAcquire(0, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.compareAndExchangeAcquire(array, Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeAcquire(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 1, 1);
+ Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeAcquire();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeAcquire(array, 0, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.compareAndExchangeRelease(null, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.compareAndExchangeRelease(Void.class, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
- int x = (int) vh.compareAndExchangeRelease(array, 0, Void.class, 1);
+ int x = (int) vh.compareAndExchangeRelease(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
- int x = (int) vh.compareAndExchangeRelease(array, 0, 1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.compareAndExchangeRelease(0, 0, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.compareAndExchangeRelease(array, Void.class, 1, 1);
+ int x = (int) vh.compareAndExchangeRelease(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.compareAndExchangeRelease(array, 0, 1, 1);
+ Void r = (Void) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 1, 1);
+ boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeRelease();
});
checkWMTE(() -> { // >
- int x = (int) vh.compareAndExchangeRelease(array, 0, 1, 1, Void.class);
+ int x = (int) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567, Void.class);
});
// GetAndSet
// Incorrect argument types
checkNPE(() -> { // null array
- int x = (int) vh.getAndSet(null, 0, 1);
+ int x = (int) vh.getAndSet(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.getAndSet(Void.class, 0, 1);
+ int x = (int) vh.getAndSet(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndSet(array, 0, Void.class);
});
checkWMTE(() -> { // reciarrayever primitive class
- int x = (int) vh.getAndSet(0, 0, 1);
+ int x = (int) vh.getAndSet(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.getAndSet(array, Void.class, 1);
+ int x = (int) vh.getAndSet(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndSet(array, 0, 1);
+ Void r = (Void) vh.getAndSet(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndSet(array, 0, 1);
+ boolean x = (boolean) vh.getAndSet(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndSet();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndSet(array, 0, 1, Void.class);
+ int x = (int) vh.getAndSet(array, 0, 0x01234567, Void.class);
});
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
- int x = (int) vh.getAndAdd(null, 0, 1);
+ int x = (int) vh.getAndAdd(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.getAndAdd(Void.class, 0, 1);
+ int x = (int) vh.getAndAdd(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.getAndAdd(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.getAndAdd(0, 0, 1);
+ int x = (int) vh.getAndAdd(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.getAndAdd(array, Void.class, 1);
+ int x = (int) vh.getAndAdd(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.getAndAdd(array, 0, 1);
+ Void r = (Void) vh.getAndAdd(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.getAndAdd(array, 0, 1);
+ boolean x = (boolean) vh.getAndAdd(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.getAndAdd();
});
checkWMTE(() -> { // >
- int x = (int) vh.getAndAdd(array, 0, 1, Void.class);
+ int x = (int) vh.getAndAdd(array, 0, 0x01234567, Void.class);
});
// AddAndGet
// Incorrect argument types
checkNPE(() -> { // null array
- int x = (int) vh.addAndGet(null, 0, 1);
+ int x = (int) vh.addAndGet(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.addAndGet(Void.class, 0, 1);
+ int x = (int) vh.addAndGet(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) vh.addAndGet(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.addAndGet(0, 0, 1);
+ int x = (int) vh.addAndGet(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.addAndGet(array, Void.class, 1);
+ int x = (int) vh.addAndGet(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, 1);
+ Void r = (Void) vh.addAndGet(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, 1);
+ boolean x = (boolean) vh.addAndGet(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.addAndGet();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(array, 0, 1, Void.class);
+ int x = (int) vh.addAndGet(array, 0, 0x01234567, Void.class);
});
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
int[] array = new int[10];
- Arrays.fill(array, 1);
+ Arrays.fill(array, 0x01234567);
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
// Incorrect argument types
checkNPE(() -> { // null array
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class)).
@@ -1946,202 +1946,202 @@
for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
// Incorrect argument types
checkNPE(() -> { // null array
hs.get(am, methodType(void.class, Void.class, int.class, int.class)).
- invoke(null, 0, 1);
+ invoke(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
hs.get(am, methodType(void.class, Class.class, int.class, int.class)).
- invoke(Void.class, 0, 1);
+ invoke(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
invoke(array, 0, Void.class);
});
checkWMTE(() -> { // receiver primitive class
hs.get(am, methodType(void.class, int.class, int.class, int.class)).
- invoke(0, 0, 1);
+ invoke(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
hs.get(am, methodType(void.class, int[].class, Class.class, int.class)).
- invoke(array, Void.class, 1);
+ invoke(array, Void.class, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
hs.get(am, methodType(void.class)).
invoke();
});
checkWMTE(() -> { // >
hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
- invoke(array, 0, 1, Void.class);
+ invoke(array, 0, 0x01234567, 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, int.class, int.class)).
- invoke(null, 0, 1, 1);
+ invoke(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class, int.class)).
- invoke(Void.class, 0, 1, 1);
+ invoke(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, Class.class, int.class)).
- invoke(array, 0, Void.class, 1);
+ invoke(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, Void.class);
+ invoke(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // receiver primitive class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, int.class, int.class)).
- invoke(0, 0, 1, 1);
+ invoke(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, Class.class, int.class, int.class)).
- invoke(array, Void.class, 1, 1);
+ invoke(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean r = (boolean) hs.get(am, methodType(boolean.class)).
invoke();
});
checkWMTE(() -> { // >
boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, 1, Void.class);
+ invoke(array, 0, 0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
// Incorrect argument types
checkNPE(() -> { // null receiver
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class, int.class)).
- invoke(null, 0, 1, 1);
+ invoke(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // array reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class, int.class)).
- invoke(Void.class, 0, 1, 1);
+ invoke(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class, int.class)).
- invoke(array, 0, Void.class, 1);
+ invoke(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, Void.class);
+ invoke(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // array primitive class
int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class, int.class)).
- invoke(0, 0, 1, 1);
+ invoke(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class, int.class)).
- invoke(array, Void.class, 1, 1);
+ invoke(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class, int.class)).
- invoke(array, 0, 1, 1);
+ invoke(array, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class)).
- invoke(array, 0, 1, 1);
+ invoke(array, 0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, 1, Void.class);
+ invoke(array, 0, 0x01234567, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
// Incorrect argument types
checkNPE(() -> { // null array
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
- invoke(null, 0, 1);
+ invoke(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
- invoke(Void.class, 0, 1);
+ invoke(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
invoke(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
- invoke(0, 0, 1);
+ invoke(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
- invoke(array, Void.class, 1);
+ invoke(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
- invoke(array, 0, 1);
+ invoke(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
- invoke(array, 0, 1);
+ invoke(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, Void.class);
+ invoke(array, 0, 0x01234567, Void.class);
});
}
for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
// Incorrect argument types
checkNPE(() -> { // null array
int x = (int) hs.get(am, methodType(int.class, Void.class, int.class, int.class)).
- invoke(null, 0, 1);
+ invoke(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
- invoke(Void.class, 0, 1);
+ invoke(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
invoke(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
- invoke(0, 0, 1);
+ invoke(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
- invoke(array, Void.class, 1);
+ invoke(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
- invoke(array, 0, 1);
+ invoke(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
- invoke(array, 0, 1);
+ invoke(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) hs.get(am, methodType(int.class)).
invoke();
});
checkWMTE(() -> { // >
int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
- invoke(array, 0, 1, Void.class);
+ invoke(array, 0, 0x01234567, Void.class);
});
}
}
}
< prev index next >