8154737: Rename VarHandle.compareAndExchangeVolatile to VarHandle.compareAndExchange

Reviewed-by: shade
This commit is contained in:
Paul Sandoz 2016-06-23 13:46:48 +02:00
parent 734dbe4089
commit 3f0273a3c4
41 changed files with 790 additions and 790 deletions

View File

@ -139,7 +139,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError;
* {@link #weakCompareAndSetAcquire weakCompareAndSetAcquire},
* {@link #weakCompareAndSetRelease weakCompareAndSetRelease},
* {@link #compareAndExchangeAcquire compareAndExchangeAcquire},
* {@link #compareAndExchangeVolatile compareAndExchangeVolatile},
* {@link #compareAndExchange compareAndExchange},
* {@link #compareAndExchangeRelease compareAndExchangeRelease},
* {@link #getAndSet getAndSet}.
* <li>numeric atomic update access modes that, for example, atomically get and
@ -706,9 +706,9 @@ public abstract class VarHandle {
* <p>The method signature is of the form {@code (CT, T expectedValue, T newValue)T}.
*
* <p>The symbolic type descriptor at the call site of {@code
* compareAndExchangeVolatile}
* compareAndExchange}
* must match the access mode type that is the result of calling
* {@code accessModeType(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE)}
* {@code accessModeType(VarHandle.AccessMode.COMPARE_AND_EXCHANGE)}
* on this VarHandle.
*
* @param args the signature-polymorphic parameter list of the form
@ -729,7 +729,7 @@ public abstract class VarHandle {
public final native
@MethodHandle.PolymorphicSignature
@HotSpotIntrinsicCandidate
Object compareAndExchangeVolatile(Object... args);
Object compareAndExchange(Object... args);
/**
* Atomically sets the value of a variable to the {@code newValue} with the
@ -1199,9 +1199,9 @@ public abstract class VarHandle {
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#compareAndExchangeVolatile VarHandle.compareAndExchangeVolatile}
* {@link VarHandle#compareAndExchange VarHandle.compareAndExchange}
*/
COMPARE_AND_EXCHANGE_VOLATILE("compareAndExchangeVolatile", AccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE("compareAndExchange", AccessType.COMPARE_AND_EXCHANGE),
/**
* The access mode whose access is specified by the corresponding
* method

View File

@ -132,7 +132,7 @@ final class VarHandle$Type$s {
}
@ForceInline
static $type$ compareAndExchangeVolatile(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) {
static $type$ compareAndExchange(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) {
return UNSAFE.compareAndExchange$Type$Volatile(Objects.requireNonNull(handle.receiverType.cast(holder)),
handle.fieldOffset,
{#if[Object]?handle.fieldType.cast(expected):expected},
@ -313,7 +313,7 @@ final class VarHandle$Type$s {
@ForceInline
static $type$ compareAndExchangeVolatile(FieldStaticReadWrite handle, $type$ expected, $type$ value) {
static $type$ compareAndExchange(FieldStaticReadWrite handle, $type$ expected, $type$ value) {
return UNSAFE.compareAndExchange$Type$Volatile(handle.base,
handle.fieldOffset,
{#if[Object]?handle.fieldType.cast(expected):expected},
@ -523,7 +523,7 @@ final class VarHandle$Type$s {
}
@ForceInline
static $type$ compareAndExchangeVolatile(Array handle, Object oarray, int index, $type$ expected, $type$ value) {
static $type$ compareAndExchange(Array handle, Object oarray, int index, $type$ expected, $type$ value) {
#if[Object]
Object[] array = (Object[]) handle.arrayType.cast(oarray);
#else[Object]

View File

@ -193,7 +193,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
}
@ForceInline
static $type$ compareAndExchangeVolatile(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
static $type$ compareAndExchange(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
byte[] ba = (byte[]) oba;
return convEndian(handle.be,
UNSAFE.compareAndExchange$RawType$Volatile(
@ -436,7 +436,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
}
@ForceInline
static $type$ compareAndExchangeVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
ByteBuffer bb = (ByteBuffer) obb;
return convEndian(handle.be,
UNSAFE.compareAndExchange$RawType$Volatile(

View File

@ -145,7 +145,7 @@ abstract class VarHandleBaseTest {
GET_OPAQUE(TestAccessType.GET),
SET_OPAQUE(TestAccessType.SET),
COMPARE_AND_SET(TestAccessType.COMPARE_AND_SET),
COMPARE_AND_EXCHANGE_VOLATILE(TestAccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE(TestAccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE_ACQUIRE(TestAccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE_RELEASE(TestAccessType.COMPARE_AND_EXCHANGE),
WEAK_COMPARE_AND_SET(TestAccessType.COMPARE_AND_SET),

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -374,17 +374,17 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(recv, false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(recv, false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) vh.get(recv);
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(recv, false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(recv, false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) vh.get(recv);
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{
@ -525,17 +525,17 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) vh.get();
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) vh.get();
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{
@ -679,17 +679,17 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(array, i, false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(array, i, false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) vh.get(array, i);
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) vh.compareAndExchangeVolatile(array, i, false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) vh.compareAndExchange(array, i, false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) vh.get(array, i);
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{
@ -828,7 +828,7 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
});
checkIOOBE(() -> {
boolean r = (boolean) vh.compareAndExchangeVolatile(array, ci, false, true);
boolean r = (boolean) vh.compareAndExchange(array, ci, false, true);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) vh.compareAndExchangeVolatile(recv, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange(recv, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) vh.get(recv);
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) vh.compareAndExchangeVolatile(recv, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange(recv, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) vh.get(recv);
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) vh.compareAndExchangeVolatile((byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange((byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) vh.get();
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) vh.compareAndExchangeVolatile((byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange((byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) vh.get();
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) vh.compareAndExchangeVolatile(array, i, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange(array, i, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) vh.get(array, i);
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) vh.compareAndExchangeVolatile(array, i, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) vh.compareAndExchange(array, i, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) vh.get(array, i);
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
});
checkIOOBE(() -> {
byte r = (byte) vh.compareAndExchangeVolatile(array, ci, (byte)0x23, (byte)0x01);
byte r = (byte) vh.compareAndExchange(array, ci, (byte)0x23, (byte)0x01);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
}
{
char r = (char) vh.compareAndExchangeVolatile(recv, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange(recv, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) vh.get(recv);
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) vh.compareAndExchangeVolatile(recv, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange(recv, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) vh.get(recv);
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
}
{
char r = (char) vh.compareAndExchangeVolatile('\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange('\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) vh.get();
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) vh.compareAndExchangeVolatile('\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange('\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) vh.get();
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
}
{
char r = (char) vh.compareAndExchangeVolatile(array, i, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange(array, i, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) vh.get(array, i);
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) vh.compareAndExchangeVolatile(array, i, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) vh.compareAndExchange(array, i, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) vh.get(array, i);
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
});
checkIOOBE(() -> {
char r = (char) vh.compareAndExchangeVolatile(array, ci, '\u4567', '\u0123');
char r = (char) vh.compareAndExchange(array, ci, '\u4567', '\u0123');
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) vh.compareAndExchangeVolatile(recv, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(recv, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) vh.get(recv);
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) vh.compareAndExchangeVolatile(recv, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(recv, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) vh.get(recv);
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) vh.compareAndExchangeVolatile(2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) vh.get();
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) vh.compareAndExchangeVolatile(2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) vh.get();
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
});
checkIOOBE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, 2.0d, 1.0d);
double r = (double) vh.compareAndExchange(array, ci, 2.0d, 1.0d);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) vh.compareAndExchangeVolatile(recv, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(recv, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) vh.get(recv);
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) vh.compareAndExchangeVolatile(recv, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(recv, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) vh.get(recv);
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) vh.compareAndExchangeVolatile(2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) vh.get();
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) vh.compareAndExchangeVolatile(2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) vh.get();
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
});
checkIOOBE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, 2.0f, 1.0f);
float r = (float) vh.compareAndExchange(array, ci, 2.0f, 1.0f);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
}
{
int r = (int) vh.compareAndExchangeVolatile(recv, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(recv, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) vh.get(recv);
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) vh.compareAndExchangeVolatile(recv, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(recv, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) vh.get(recv);
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
}
{
int r = (int) vh.compareAndExchangeVolatile(0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) vh.get();
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) vh.compareAndExchangeVolatile(0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) vh.get();
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
});
checkIOOBE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, 0x89ABCDEF, 0x01234567);
int r = (int) vh.compareAndExchange(array, ci, 0x89ABCDEF, 0x01234567);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
}
{
long r = (long) vh.compareAndExchangeVolatile(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) vh.get(recv);
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) vh.compareAndExchangeVolatile(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) vh.get(recv);
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
}
{
long r = (long) vh.compareAndExchangeVolatile(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) vh.get();
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) vh.compareAndExchangeVolatile(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) vh.get();
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
});
checkIOOBE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
long r = (long) vh.compareAndExchange(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -360,17 +360,17 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
}
{
short r = (short) vh.compareAndExchangeVolatile(recv, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange(recv, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) vh.get(recv);
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) vh.compareAndExchangeVolatile(recv, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange(recv, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) vh.get(recv);
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{
@ -513,17 +513,17 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
}
{
short r = (short) vh.compareAndExchangeVolatile((short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange((short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) vh.get();
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) vh.compareAndExchangeVolatile((short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange((short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) vh.get();
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{
@ -669,17 +669,17 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
}
{
short r = (short) vh.compareAndExchangeVolatile(array, i, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange(array, i, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) vh.get(array, i);
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) vh.compareAndExchangeVolatile(array, i, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) vh.compareAndExchange(array, i, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) vh.get(array, i);
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{
@ -820,7 +820,7 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
});
checkIOOBE(() -> {
short r = (short) vh.compareAndExchangeVolatile(array, ci, (short)0x4567, (short)0x0123);
short r = (short) vh.compareAndExchange(array, ci, (short)0x4567, (short)0x0123);
});
checkIOOBE(() -> {

View File

@ -100,7 +100,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -374,17 +374,17 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
}
{
String r = (String) vh.compareAndExchangeVolatile(recv, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange(recv, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) vh.get(recv);
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) vh.compareAndExchangeVolatile(recv, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange(recv, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) vh.get(recv);
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{
@ -525,17 +525,17 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
}
{
String r = (String) vh.compareAndExchangeVolatile("bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange("bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) vh.get();
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) vh.compareAndExchangeVolatile("bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange("bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) vh.get();
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{
@ -679,17 +679,17 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
}
{
String r = (String) vh.compareAndExchangeVolatile(array, i, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange(array, i, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) vh.get(array, i);
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) vh.compareAndExchangeVolatile(array, i, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) vh.compareAndExchange(array, i, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) vh.get(array, i);
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{
@ -828,7 +828,7 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
});
checkIOOBE(() -> {
String r = (String) vh.compareAndExchangeVolatile(array, ci, "bar", "foo");
String r = (String) vh.compareAndExchange(array, ci, "bar", "foo");
});
checkIOOBE(() -> {

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsChar extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -189,7 +189,7 @@ public class VarHandleTestByteArrayAsChar extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -258,7 +258,7 @@ public class VarHandleTestByteArrayAsChar extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -303,7 +303,7 @@ public class VarHandleTestByteArrayAsChar extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -224,7 +224,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
});
checkROBE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkROBE(() -> {
@ -321,7 +321,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -406,7 +406,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -482,7 +482,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -561,7 +561,7 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -656,17 +656,17 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile double value");
assertEquals(x, VALUE_1, "success compareAndExchange double value");
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile double value");
assertEquals(x, VALUE_1, "failing compareAndExchange double value");
}
{
@ -805,17 +805,17 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile double value");
assertEquals(x, VALUE_1, "success compareAndExchange double value");
}
{
double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile double");
double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile double value");
assertEquals(x, VALUE_1, "failing compareAndExchange double value");
}
{

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -224,7 +224,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
});
checkROBE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkROBE(() -> {
@ -321,7 +321,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -406,7 +406,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -482,7 +482,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -561,7 +561,7 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -656,17 +656,17 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile float value");
assertEquals(x, VALUE_1, "success compareAndExchange float value");
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile float value");
assertEquals(x, VALUE_1, "failing compareAndExchange float value");
}
{
@ -805,17 +805,17 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile float value");
assertEquals(x, VALUE_1, "success compareAndExchange float value");
}
{
float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile float");
float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile float value");
assertEquals(x, VALUE_1, "failing compareAndExchange float value");
}
{

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -217,7 +217,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
});
checkROBE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkROBE(() -> {
@ -307,7 +307,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -399,7 +399,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -482,7 +482,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -568,7 +568,7 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -670,17 +670,17 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile int value");
assertEquals(x, VALUE_1, "success compareAndExchange int value");
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile int value");
assertEquals(x, VALUE_1, "failing compareAndExchange int value");
}
{
@ -828,17 +828,17 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile int value");
assertEquals(x, VALUE_1, "success compareAndExchange int value");
}
{
int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile int");
int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile int value");
assertEquals(x, VALUE_1, "failing compareAndExchange int value");
}
{

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -217,7 +217,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
});
checkROBE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkROBE(() -> {
@ -307,7 +307,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -399,7 +399,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -482,7 +482,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -568,7 +568,7 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -670,17 +670,17 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile long value");
assertEquals(x, VALUE_1, "success compareAndExchange long value");
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile long value");
assertEquals(x, VALUE_1, "failing compareAndExchange long value");
}
{
@ -828,17 +828,17 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile long value");
assertEquals(x, VALUE_1, "success compareAndExchange long value");
}
{
long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile long");
long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile long value");
assertEquals(x, VALUE_1, "failing compareAndExchange long value");
}
{

View File

@ -89,7 +89,7 @@ public class VarHandleTestByteArrayAsShort extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -189,7 +189,7 @@ public class VarHandleTestByteArrayAsShort extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -258,7 +258,7 @@ public class VarHandleTestByteArrayAsShort extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -303,7 +303,7 @@ public class VarHandleTestByteArrayAsShort extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{
@ -315,17 +315,17 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{
@ -467,17 +467,17 @@ public class VarHandleTestMethodHandleAccessBoolean extends VarHandleBaseTest {
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, false, true);
assertEquals(r, false, "success compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, false, true);
assertEquals(r, false, "success compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, true, "success compareAndExchangeVolatile boolean value");
assertEquals(x, true, "success compareAndExchange boolean value");
}
{
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, false, false);
assertEquals(r, true, "failing compareAndExchangeVolatile boolean");
boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, false, false);
assertEquals(r, true, "failing compareAndExchange boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, true, "failing compareAndExchangeVolatile boolean value");
assertEquals(x, true, "failing compareAndExchange boolean value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact((byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact((byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (byte)0x23, (byte)0x01);
assertEquals(r, (byte)0x23, "success compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
}
{
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte");
byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (byte)0x23, (byte)0x45);
assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value");
assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact('\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact('\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact('\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact('\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, '\u4567', '\u0123');
assertEquals(r, '\u4567', "success compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "success compareAndExchange char value");
}
{
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char");
char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, '\u4567', '\u89AB');
assertEquals(r, '\u0123', "failing compareAndExchange char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value");
assertEquals(x, '\u0123', "failing compareAndExchange char value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessDouble extends VarHandleBaseTest {
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0d, 1.0d);
assertEquals(r, 2.0d, "success compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "success compareAndExchange double value");
}
{
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double");
double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0d, 3.0d);
assertEquals(r, 1.0d, "failing compareAndExchange double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value");
assertEquals(x, 1.0d, "failing compareAndExchange double value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessFloat extends VarHandleBaseTest {
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0f, 1.0f);
assertEquals(r, 2.0f, "success compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "success compareAndExchange float value");
}
{
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float");
float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0f, 3.0f);
assertEquals(r, 1.0f, "failing compareAndExchange float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value");
assertEquals(x, 1.0f, "failing compareAndExchange float value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "success compareAndExchange int value");
}
{
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int");
int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0x89ABCDEF, 0xCAFEBABE);
assertEquals(r, 0x01234567, "failing compareAndExchange int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value");
assertEquals(x, 0x01234567, "failing compareAndExchange int value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
}
{
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long");
long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value");
assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{
@ -319,17 +319,17 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact((short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact((short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{
@ -475,17 +475,17 @@ public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (short)0x4567, (short)0x0123);
assertEquals(r, (short)0x4567, "success compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "success compareAndExchange short value");
}
{
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (short)0x4567, (short)0x89AB);
assertEquals(r, (short)0x0123, "failing compareAndExchange short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
}
{

View File

@ -166,17 +166,17 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{
@ -315,17 +315,17 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact("bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact("bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact("bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact("bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{
@ -467,17 +467,17 @@ public class VarHandleTestMethodHandleAccessString extends VarHandleBaseTest {
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, "bar", "foo");
assertEquals(r, "bar", "success compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
assertEquals(x, "foo", "success compareAndExchange String value");
}
{
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, "bar", "baz");
assertEquals(r, "foo", "failing compareAndExchange String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
assertEquals(x, "foo", "failing compareAndExchange String value");
}
{

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeBoolean extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
boolean x = (boolean) vh.compareAndExchangeVolatile(null, true, true);
boolean x = (boolean) vh.compareAndExchange(null, true, true);
});
checkCCE(() -> { // receiver reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(Void.class, true, true);
boolean x = (boolean) vh.compareAndExchange(Void.class, true, true);
});
checkWMTE(() -> { // expected reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, Void.class, true);
boolean x = (boolean) vh.compareAndExchange(recv, Void.class, true);
});
checkWMTE(() -> { // actual reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, true, Void.class);
boolean x = (boolean) vh.compareAndExchange(recv, true, Void.class);
});
checkWMTE(() -> { // reciever primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(0, true, true);
boolean x = (boolean) vh.compareAndExchange(0, true, true);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, true, true);
Void r = (Void) vh.compareAndExchange(recv, true, true);
});
checkWMTE(() -> { // primitive class
int x = (int) vh.compareAndExchangeVolatile(recv, true, true);
int x = (int) vh.compareAndExchange(recv, true, true);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean x = (boolean) vh.compareAndExchangeVolatile();
boolean x = (boolean) vh.compareAndExchange();
});
checkWMTE(() -> { // >
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, true, true, Void.class);
boolean x = (boolean) vh.compareAndExchange(recv, true, true, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
boolean x = (boolean) vh.compareAndExchangeAcquire(null, true, true);
@ -957,27 +957,27 @@ public class VarHandleTestMethodTypeBoolean extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(Void.class, true);
boolean x = (boolean) vh.compareAndExchange(Void.class, true);
});
checkWMTE(() -> { // actual reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(true, Void.class);
boolean x = (boolean) vh.compareAndExchange(true, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(true, true);
Void r = (Void) vh.compareAndExchange(true, true);
});
checkWMTE(() -> { // primitive class
int x = (int) vh.compareAndExchangeVolatile(true, true);
int x = (int) vh.compareAndExchange(true, true);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean x = (boolean) vh.compareAndExchangeVolatile();
boolean x = (boolean) vh.compareAndExchange();
});
checkWMTE(() -> { // >
boolean x = (boolean) vh.compareAndExchangeVolatile(true, true, Void.class);
boolean x = (boolean) vh.compareAndExchange(true, true, Void.class);
});
@ -1539,39 +1539,39 @@ public class VarHandleTestMethodTypeBoolean extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
boolean x = (boolean) vh.compareAndExchangeVolatile(null, 0, true, true);
boolean x = (boolean) vh.compareAndExchange(null, 0, true, true);
});
checkCCE(() -> { // array reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(Void.class, 0, true, true);
boolean x = (boolean) vh.compareAndExchange(Void.class, 0, true, true);
});
checkWMTE(() -> { // expected reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, Void.class, true);
boolean x = (boolean) vh.compareAndExchange(array, 0, Void.class, true);
});
checkWMTE(() -> { // actual reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, true, Void.class);
boolean x = (boolean) vh.compareAndExchange(array, 0, true, Void.class);
});
checkWMTE(() -> { // array primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(0, 0, true, true);
boolean x = (boolean) vh.compareAndExchange(0, 0, true, true);
});
checkWMTE(() -> { // index reference class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, Void.class, true, true);
boolean x = (boolean) vh.compareAndExchange(array, Void.class, true, true);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, true, true);
Void r = (Void) vh.compareAndExchange(array, 0, true, true);
});
checkWMTE(() -> { // primitive class
int x = (int) vh.compareAndExchangeVolatile(array, 0, true, true);
int x = (int) vh.compareAndExchange(array, 0, true, true);
});
// Incorrect arity
checkWMTE(() -> { // 0
boolean x = (boolean) vh.compareAndExchangeVolatile();
boolean x = (boolean) vh.compareAndExchange();
});
checkWMTE(() -> { // >
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, true, true, Void.class);
boolean x = (boolean) vh.compareAndExchange(array, 0, true, true, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeByte extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
byte x = (byte) vh.compareAndExchangeVolatile(null, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(null, (byte)0x01, (byte)0x01);
});
checkCCE(() -> { // receiver reference class
byte x = (byte) vh.compareAndExchangeVolatile(Void.class, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // expected reference class
byte x = (byte) vh.compareAndExchangeVolatile(recv, Void.class, (byte)0x01);
byte x = (byte) vh.compareAndExchange(recv, Void.class, (byte)0x01);
});
checkWMTE(() -> { // actual reference class
byte x = (byte) vh.compareAndExchangeVolatile(recv, (byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, Void.class);
});
checkWMTE(() -> { // reciever primitive class
byte x = (byte) vh.compareAndExchangeVolatile(0, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(0, (byte)0x01, (byte)0x01);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, (byte)0x01, (byte)0x01);
Void r = (Void) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, (byte)0x01, (byte)0x01);
boolean x = (boolean) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
byte x = (byte) vh.compareAndExchangeVolatile();
byte x = (byte) vh.compareAndExchange();
});
checkWMTE(() -> { // >
byte x = (byte) vh.compareAndExchangeVolatile(recv, (byte)0x01, (byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
byte x = (byte) vh.compareAndExchangeAcquire(null, (byte)0x01, (byte)0x01);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeByte extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
byte x = (byte) vh.compareAndExchangeVolatile(Void.class, (byte)0x01);
byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01);
});
checkWMTE(() -> { // actual reference class
byte x = (byte) vh.compareAndExchangeVolatile((byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange((byte)0x01, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile((byte)0x01, (byte)0x01);
Void r = (Void) vh.compareAndExchange((byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile((byte)0x01, (byte)0x01);
boolean x = (boolean) vh.compareAndExchange((byte)0x01, (byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
byte x = (byte) vh.compareAndExchangeVolatile();
byte x = (byte) vh.compareAndExchange();
});
checkWMTE(() -> { // >
byte x = (byte) vh.compareAndExchangeVolatile((byte)0x01, (byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange((byte)0x01, (byte)0x01, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeByte extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
byte x = (byte) vh.compareAndExchangeVolatile(null, 0, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(null, 0, (byte)0x01, (byte)0x01);
});
checkCCE(() -> { // array reference class
byte x = (byte) vh.compareAndExchangeVolatile(Void.class, 0, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(Void.class, 0, (byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // expected reference class
byte x = (byte) vh.compareAndExchangeVolatile(array, 0, Void.class, (byte)0x01);
byte x = (byte) vh.compareAndExchange(array, 0, Void.class, (byte)0x01);
});
checkWMTE(() -> { // actual reference class
byte x = (byte) vh.compareAndExchangeVolatile(array, 0, (byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange(array, 0, (byte)0x01, Void.class);
});
checkWMTE(() -> { // array primitive class
byte x = (byte) vh.compareAndExchangeVolatile(0, 0, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(0, 0, (byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // index reference class
byte x = (byte) vh.compareAndExchangeVolatile(array, Void.class, (byte)0x01, (byte)0x01);
byte x = (byte) vh.compareAndExchange(array, Void.class, (byte)0x01, (byte)0x01);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, (byte)0x01, (byte)0x01);
Void r = (Void) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, (byte)0x01, (byte)0x01);
boolean x = (boolean) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
byte x = (byte) vh.compareAndExchangeVolatile();
byte x = (byte) vh.compareAndExchange();
});
checkWMTE(() -> { // >
byte x = (byte) vh.compareAndExchangeVolatile(array, 0, (byte)0x01, (byte)0x01, Void.class);
byte x = (byte) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeChar extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
char x = (char) vh.compareAndExchangeVolatile(null, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(null, '\u0123', '\u0123');
});
checkCCE(() -> { // receiver reference class
char x = (char) vh.compareAndExchangeVolatile(Void.class, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(Void.class, '\u0123', '\u0123');
});
checkWMTE(() -> { // expected reference class
char x = (char) vh.compareAndExchangeVolatile(recv, Void.class, '\u0123');
char x = (char) vh.compareAndExchange(recv, Void.class, '\u0123');
});
checkWMTE(() -> { // actual reference class
char x = (char) vh.compareAndExchangeVolatile(recv, '\u0123', Void.class);
char x = (char) vh.compareAndExchange(recv, '\u0123', Void.class);
});
checkWMTE(() -> { // reciever primitive class
char x = (char) vh.compareAndExchangeVolatile(0, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(0, '\u0123', '\u0123');
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123');
Void r = (Void) vh.compareAndExchange(recv, '\u0123', '\u0123');
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123');
boolean x = (boolean) vh.compareAndExchange(recv, '\u0123', '\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
char x = (char) vh.compareAndExchangeVolatile();
char x = (char) vh.compareAndExchange();
});
checkWMTE(() -> { // >
char x = (char) vh.compareAndExchangeVolatile(recv, '\u0123', '\u0123', Void.class);
char x = (char) vh.compareAndExchange(recv, '\u0123', '\u0123', Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
char x = (char) vh.compareAndExchangeAcquire(null, '\u0123', '\u0123');
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeChar extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
char x = (char) vh.compareAndExchangeVolatile(Void.class, '\u0123');
char x = (char) vh.compareAndExchange(Void.class, '\u0123');
});
checkWMTE(() -> { // actual reference class
char x = (char) vh.compareAndExchangeVolatile('\u0123', Void.class);
char x = (char) vh.compareAndExchange('\u0123', Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile('\u0123', '\u0123');
Void r = (Void) vh.compareAndExchange('\u0123', '\u0123');
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile('\u0123', '\u0123');
boolean x = (boolean) vh.compareAndExchange('\u0123', '\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
char x = (char) vh.compareAndExchangeVolatile();
char x = (char) vh.compareAndExchange();
});
checkWMTE(() -> { // >
char x = (char) vh.compareAndExchangeVolatile('\u0123', '\u0123', Void.class);
char x = (char) vh.compareAndExchange('\u0123', '\u0123', Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeChar extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
char x = (char) vh.compareAndExchangeVolatile(null, 0, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(null, 0, '\u0123', '\u0123');
});
checkCCE(() -> { // array reference class
char x = (char) vh.compareAndExchangeVolatile(Void.class, 0, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(Void.class, 0, '\u0123', '\u0123');
});
checkWMTE(() -> { // expected reference class
char x = (char) vh.compareAndExchangeVolatile(array, 0, Void.class, '\u0123');
char x = (char) vh.compareAndExchange(array, 0, Void.class, '\u0123');
});
checkWMTE(() -> { // actual reference class
char x = (char) vh.compareAndExchangeVolatile(array, 0, '\u0123', Void.class);
char x = (char) vh.compareAndExchange(array, 0, '\u0123', Void.class);
});
checkWMTE(() -> { // array primitive class
char x = (char) vh.compareAndExchangeVolatile(0, 0, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(0, 0, '\u0123', '\u0123');
});
checkWMTE(() -> { // index reference class
char x = (char) vh.compareAndExchangeVolatile(array, Void.class, '\u0123', '\u0123');
char x = (char) vh.compareAndExchange(array, Void.class, '\u0123', '\u0123');
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123');
Void r = (Void) vh.compareAndExchange(array, 0, '\u0123', '\u0123');
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123');
boolean x = (boolean) vh.compareAndExchange(array, 0, '\u0123', '\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
char x = (char) vh.compareAndExchangeVolatile();
char x = (char) vh.compareAndExchange();
});
checkWMTE(() -> { // >
char x = (char) vh.compareAndExchangeVolatile(array, 0, '\u0123', '\u0123', Void.class);
char x = (char) vh.compareAndExchange(array, 0, '\u0123', '\u0123', Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeDouble extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
double x = (double) vh.compareAndExchangeVolatile(null, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(null, 1.0d, 1.0d);
});
checkCCE(() -> { // receiver reference class
double x = (double) vh.compareAndExchangeVolatile(Void.class, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(Void.class, 1.0d, 1.0d);
});
checkWMTE(() -> { // expected reference class
double x = (double) vh.compareAndExchangeVolatile(recv, Void.class, 1.0d);
double x = (double) vh.compareAndExchange(recv, Void.class, 1.0d);
});
checkWMTE(() -> { // actual reference class
double x = (double) vh.compareAndExchangeVolatile(recv, 1.0d, Void.class);
double x = (double) vh.compareAndExchange(recv, 1.0d, Void.class);
});
checkWMTE(() -> { // reciever primitive class
double x = (double) vh.compareAndExchangeVolatile(0, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(0, 1.0d, 1.0d);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, 1.0d, 1.0d);
Void r = (Void) vh.compareAndExchange(recv, 1.0d, 1.0d);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 1.0d, 1.0d);
boolean x = (boolean) vh.compareAndExchange(recv, 1.0d, 1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
double x = (double) vh.compareAndExchangeVolatile();
double x = (double) vh.compareAndExchange();
});
checkWMTE(() -> { // >
double x = (double) vh.compareAndExchangeVolatile(recv, 1.0d, 1.0d, Void.class);
double x = (double) vh.compareAndExchange(recv, 1.0d, 1.0d, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
double x = (double) vh.compareAndExchangeAcquire(null, 1.0d, 1.0d);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeDouble extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
double x = (double) vh.compareAndExchangeVolatile(Void.class, 1.0d);
double x = (double) vh.compareAndExchange(Void.class, 1.0d);
});
checkWMTE(() -> { // actual reference class
double x = (double) vh.compareAndExchangeVolatile(1.0d, Void.class);
double x = (double) vh.compareAndExchange(1.0d, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(1.0d, 1.0d);
Void r = (Void) vh.compareAndExchange(1.0d, 1.0d);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(1.0d, 1.0d);
boolean x = (boolean) vh.compareAndExchange(1.0d, 1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
double x = (double) vh.compareAndExchangeVolatile();
double x = (double) vh.compareAndExchange();
});
checkWMTE(() -> { // >
double x = (double) vh.compareAndExchangeVolatile(1.0d, 1.0d, Void.class);
double x = (double) vh.compareAndExchange(1.0d, 1.0d, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeDouble extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
double x = (double) vh.compareAndExchangeVolatile(null, 0, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(null, 0, 1.0d, 1.0d);
});
checkCCE(() -> { // array reference class
double x = (double) vh.compareAndExchangeVolatile(Void.class, 0, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(Void.class, 0, 1.0d, 1.0d);
});
checkWMTE(() -> { // expected reference class
double x = (double) vh.compareAndExchangeVolatile(array, 0, Void.class, 1.0d);
double x = (double) vh.compareAndExchange(array, 0, Void.class, 1.0d);
});
checkWMTE(() -> { // actual reference class
double x = (double) vh.compareAndExchangeVolatile(array, 0, 1.0d, Void.class);
double x = (double) vh.compareAndExchange(array, 0, 1.0d, Void.class);
});
checkWMTE(() -> { // array primitive class
double x = (double) vh.compareAndExchangeVolatile(0, 0, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(0, 0, 1.0d, 1.0d);
});
checkWMTE(() -> { // index reference class
double x = (double) vh.compareAndExchangeVolatile(array, Void.class, 1.0d, 1.0d);
double x = (double) vh.compareAndExchange(array, Void.class, 1.0d, 1.0d);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 1.0d, 1.0d);
Void r = (Void) vh.compareAndExchange(array, 0, 1.0d, 1.0d);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 1.0d, 1.0d);
boolean x = (boolean) vh.compareAndExchange(array, 0, 1.0d, 1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
double x = (double) vh.compareAndExchangeVolatile();
double x = (double) vh.compareAndExchange();
});
checkWMTE(() -> { // >
double x = (double) vh.compareAndExchangeVolatile(array, 0, 1.0d, 1.0d, Void.class);
double x = (double) vh.compareAndExchange(array, 0, 1.0d, 1.0d, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeFloat extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
float x = (float) vh.compareAndExchangeVolatile(null, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(null, 1.0f, 1.0f);
});
checkCCE(() -> { // receiver reference class
float x = (float) vh.compareAndExchangeVolatile(Void.class, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(Void.class, 1.0f, 1.0f);
});
checkWMTE(() -> { // expected reference class
float x = (float) vh.compareAndExchangeVolatile(recv, Void.class, 1.0f);
float x = (float) vh.compareAndExchange(recv, Void.class, 1.0f);
});
checkWMTE(() -> { // actual reference class
float x = (float) vh.compareAndExchangeVolatile(recv, 1.0f, Void.class);
float x = (float) vh.compareAndExchange(recv, 1.0f, Void.class);
});
checkWMTE(() -> { // reciever primitive class
float x = (float) vh.compareAndExchangeVolatile(0, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(0, 1.0f, 1.0f);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, 1.0f, 1.0f);
Void r = (Void) vh.compareAndExchange(recv, 1.0f, 1.0f);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 1.0f, 1.0f);
boolean x = (boolean) vh.compareAndExchange(recv, 1.0f, 1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
float x = (float) vh.compareAndExchangeVolatile();
float x = (float) vh.compareAndExchange();
});
checkWMTE(() -> { // >
float x = (float) vh.compareAndExchangeVolatile(recv, 1.0f, 1.0f, Void.class);
float x = (float) vh.compareAndExchange(recv, 1.0f, 1.0f, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
float x = (float) vh.compareAndExchangeAcquire(null, 1.0f, 1.0f);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeFloat extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
float x = (float) vh.compareAndExchangeVolatile(Void.class, 1.0f);
float x = (float) vh.compareAndExchange(Void.class, 1.0f);
});
checkWMTE(() -> { // actual reference class
float x = (float) vh.compareAndExchangeVolatile(1.0f, Void.class);
float x = (float) vh.compareAndExchange(1.0f, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(1.0f, 1.0f);
Void r = (Void) vh.compareAndExchange(1.0f, 1.0f);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(1.0f, 1.0f);
boolean x = (boolean) vh.compareAndExchange(1.0f, 1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
float x = (float) vh.compareAndExchangeVolatile();
float x = (float) vh.compareAndExchange();
});
checkWMTE(() -> { // >
float x = (float) vh.compareAndExchangeVolatile(1.0f, 1.0f, Void.class);
float x = (float) vh.compareAndExchange(1.0f, 1.0f, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeFloat extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
float x = (float) vh.compareAndExchangeVolatile(null, 0, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(null, 0, 1.0f, 1.0f);
});
checkCCE(() -> { // array reference class
float x = (float) vh.compareAndExchangeVolatile(Void.class, 0, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(Void.class, 0, 1.0f, 1.0f);
});
checkWMTE(() -> { // expected reference class
float x = (float) vh.compareAndExchangeVolatile(array, 0, Void.class, 1.0f);
float x = (float) vh.compareAndExchange(array, 0, Void.class, 1.0f);
});
checkWMTE(() -> { // actual reference class
float x = (float) vh.compareAndExchangeVolatile(array, 0, 1.0f, Void.class);
float x = (float) vh.compareAndExchange(array, 0, 1.0f, Void.class);
});
checkWMTE(() -> { // array primitive class
float x = (float) vh.compareAndExchangeVolatile(0, 0, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(0, 0, 1.0f, 1.0f);
});
checkWMTE(() -> { // index reference class
float x = (float) vh.compareAndExchangeVolatile(array, Void.class, 1.0f, 1.0f);
float x = (float) vh.compareAndExchange(array, Void.class, 1.0f, 1.0f);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 1.0f, 1.0f);
Void r = (Void) vh.compareAndExchange(array, 0, 1.0f, 1.0f);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 1.0f, 1.0f);
boolean x = (boolean) vh.compareAndExchange(array, 0, 1.0f, 1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
float x = (float) vh.compareAndExchangeVolatile();
float x = (float) vh.compareAndExchange();
});
checkWMTE(() -> { // >
float x = (float) vh.compareAndExchangeVolatile(array, 0, 1.0f, 1.0f, Void.class);
float x = (float) vh.compareAndExchange(array, 0, 1.0f, 1.0f, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeInt extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
int x = (int) vh.compareAndExchangeVolatile(null, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
int x = (int) vh.compareAndExchangeVolatile(Void.class, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(Void.class, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
int x = (int) vh.compareAndExchangeVolatile(recv, Void.class, 0x01234567);
int x = (int) vh.compareAndExchange(recv, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) vh.compareAndExchangeVolatile(recv, 0x01234567, Void.class);
int x = (int) vh.compareAndExchange(recv, 0x01234567, Void.class);
});
checkWMTE(() -> { // reciever primitive class
int x = (int) vh.compareAndExchangeVolatile(0, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(0, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567);
Void r = (Void) vh.compareAndExchange(recv, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567);
boolean x = (boolean) vh.compareAndExchange(recv, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
int x = (int) vh.compareAndExchange();
});
checkWMTE(() -> { // >
int x = (int) vh.compareAndExchangeVolatile(recv, 0x01234567, 0x01234567, Void.class);
int x = (int) vh.compareAndExchange(recv, 0x01234567, 0x01234567, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
int x = (int) vh.compareAndExchangeAcquire(null, 0x01234567, 0x01234567);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeInt extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
int x = (int) vh.compareAndExchangeVolatile(Void.class, 0x01234567);
int x = (int) vh.compareAndExchange(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) vh.compareAndExchangeVolatile(0x01234567, Void.class);
int x = (int) vh.compareAndExchange(0x01234567, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(0x01234567, 0x01234567);
Void r = (Void) vh.compareAndExchange(0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(0x01234567, 0x01234567);
boolean x = (boolean) vh.compareAndExchange(0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
int x = (int) vh.compareAndExchange();
});
checkWMTE(() -> { // >
int x = (int) vh.compareAndExchangeVolatile(0x01234567, 0x01234567, Void.class);
int x = (int) vh.compareAndExchange(0x01234567, 0x01234567, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeInt extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
int x = (int) vh.compareAndExchangeVolatile(null, 0, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // array reference class
int x = (int) vh.compareAndExchangeVolatile(Void.class, 0, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(Void.class, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // expected reference class
int x = (int) vh.compareAndExchangeVolatile(array, 0, Void.class, 0x01234567);
int x = (int) vh.compareAndExchange(array, 0, Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
int x = (int) vh.compareAndExchangeVolatile(array, 0, 0x01234567, Void.class);
int x = (int) vh.compareAndExchange(array, 0, 0x01234567, Void.class);
});
checkWMTE(() -> { // array primitive class
int x = (int) vh.compareAndExchangeVolatile(0, 0, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(0, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // index reference class
int x = (int) vh.compareAndExchangeVolatile(array, Void.class, 0x01234567, 0x01234567);
int x = (int) vh.compareAndExchange(array, Void.class, 0x01234567, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567);
Void r = (Void) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567);
boolean x = (boolean) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
int x = (int) vh.compareAndExchangeVolatile();
int x = (int) vh.compareAndExchange();
});
checkWMTE(() -> { // >
int x = (int) vh.compareAndExchangeVolatile(array, 0, 0x01234567, 0x01234567, Void.class);
int x = (int) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeLong extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
long x = (long) vh.compareAndExchangeVolatile(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // receiver reference class
long x = (long) vh.compareAndExchangeVolatile(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // expected reference class
long x = (long) vh.compareAndExchangeVolatile(recv, Void.class, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(recv, Void.class, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // actual reference class
long x = (long) vh.compareAndExchangeVolatile(recv, 0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, Void.class);
});
checkWMTE(() -> { // reciever primitive class
long x = (long) vh.compareAndExchangeVolatile(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
Void r = (Void) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
boolean x = (boolean) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
long x = (long) vh.compareAndExchangeVolatile();
long x = (long) vh.compareAndExchange();
});
checkWMTE(() -> { // >
long x = (long) vh.compareAndExchangeVolatile(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
long x = (long) vh.compareAndExchangeAcquire(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeLong extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
long x = (long) vh.compareAndExchangeVolatile(Void.class, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // actual reference class
long x = (long) vh.compareAndExchangeVolatile(0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(0x0123456789ABCDEFL, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
Void r = (Void) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
boolean x = (boolean) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
long x = (long) vh.compareAndExchangeVolatile();
long x = (long) vh.compareAndExchange();
});
checkWMTE(() -> { // >
long x = (long) vh.compareAndExchangeVolatile(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeLong extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
long x = (long) vh.compareAndExchangeVolatile(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // array reference class
long x = (long) vh.compareAndExchangeVolatile(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // expected reference class
long x = (long) vh.compareAndExchangeVolatile(array, 0, Void.class, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(array, 0, Void.class, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // actual reference class
long x = (long) vh.compareAndExchangeVolatile(array, 0, 0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, Void.class);
});
checkWMTE(() -> { // array primitive class
long x = (long) vh.compareAndExchangeVolatile(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // index reference class
long x = (long) vh.compareAndExchangeVolatile(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
long x = (long) vh.compareAndExchange(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
Void r = (Void) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
boolean x = (boolean) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
long x = (long) vh.compareAndExchangeVolatile();
long x = (long) vh.compareAndExchange();
});
checkWMTE(() -> { // >
long x = (long) vh.compareAndExchangeVolatile(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
long x = (long) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeShort extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
short x = (short) vh.compareAndExchangeVolatile(null, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(null, (short)0x0123, (short)0x0123);
});
checkCCE(() -> { // receiver reference class
short x = (short) vh.compareAndExchangeVolatile(Void.class, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(Void.class, (short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // expected reference class
short x = (short) vh.compareAndExchangeVolatile(recv, Void.class, (short)0x0123);
short x = (short) vh.compareAndExchange(recv, Void.class, (short)0x0123);
});
checkWMTE(() -> { // actual reference class
short x = (short) vh.compareAndExchangeVolatile(recv, (short)0x0123, Void.class);
short x = (short) vh.compareAndExchange(recv, (short)0x0123, Void.class);
});
checkWMTE(() -> { // reciever primitive class
short x = (short) vh.compareAndExchangeVolatile(0, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(0, (short)0x0123, (short)0x0123);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, (short)0x0123, (short)0x0123);
Void r = (Void) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, (short)0x0123, (short)0x0123);
boolean x = (boolean) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
short x = (short) vh.compareAndExchangeVolatile();
short x = (short) vh.compareAndExchange();
});
checkWMTE(() -> { // >
short x = (short) vh.compareAndExchangeVolatile(recv, (short)0x0123, (short)0x0123, Void.class);
short x = (short) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
short x = (short) vh.compareAndExchangeAcquire(null, (short)0x0123, (short)0x0123);
@ -1051,27 +1051,27 @@ public class VarHandleTestMethodTypeShort extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkWMTE(() -> { // expected reference class
short x = (short) vh.compareAndExchangeVolatile(Void.class, (short)0x0123);
short x = (short) vh.compareAndExchange(Void.class, (short)0x0123);
});
checkWMTE(() -> { // actual reference class
short x = (short) vh.compareAndExchangeVolatile((short)0x0123, Void.class);
short x = (short) vh.compareAndExchange((short)0x0123, Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile((short)0x0123, (short)0x0123);
Void r = (Void) vh.compareAndExchange((short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile((short)0x0123, (short)0x0123);
boolean x = (boolean) vh.compareAndExchange((short)0x0123, (short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
short x = (short) vh.compareAndExchangeVolatile();
short x = (short) vh.compareAndExchange();
});
checkWMTE(() -> { // >
short x = (short) vh.compareAndExchangeVolatile((short)0x0123, (short)0x0123, Void.class);
short x = (short) vh.compareAndExchange((short)0x0123, (short)0x0123, Void.class);
});
@ -1698,39 +1698,39 @@ public class VarHandleTestMethodTypeShort extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
short x = (short) vh.compareAndExchangeVolatile(null, 0, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(null, 0, (short)0x0123, (short)0x0123);
});
checkCCE(() -> { // array reference class
short x = (short) vh.compareAndExchangeVolatile(Void.class, 0, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(Void.class, 0, (short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // expected reference class
short x = (short) vh.compareAndExchangeVolatile(array, 0, Void.class, (short)0x0123);
short x = (short) vh.compareAndExchange(array, 0, Void.class, (short)0x0123);
});
checkWMTE(() -> { // actual reference class
short x = (short) vh.compareAndExchangeVolatile(array, 0, (short)0x0123, Void.class);
short x = (short) vh.compareAndExchange(array, 0, (short)0x0123, Void.class);
});
checkWMTE(() -> { // array primitive class
short x = (short) vh.compareAndExchangeVolatile(0, 0, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(0, 0, (short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // index reference class
short x = (short) vh.compareAndExchangeVolatile(array, Void.class, (short)0x0123, (short)0x0123);
short x = (short) vh.compareAndExchange(array, Void.class, (short)0x0123, (short)0x0123);
});
// Incorrect return type
checkWMTE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, (short)0x0123, (short)0x0123);
Void r = (Void) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123);
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, (short)0x0123, (short)0x0123);
boolean x = (boolean) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
short x = (short) vh.compareAndExchangeVolatile();
short x = (short) vh.compareAndExchange();
});
checkWMTE(() -> { // >
short x = (short) vh.compareAndExchangeVolatile(array, 0, (short)0x0123, (short)0x0123, Void.class);
short x = (short) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123, Void.class);
});

View File

@ -454,40 +454,40 @@ public class VarHandleTestMethodTypeString extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
String x = (String) vh.compareAndExchangeVolatile(null, "foo", "foo");
String x = (String) vh.compareAndExchange(null, "foo", "foo");
});
checkCCE(() -> { // receiver reference class
String x = (String) vh.compareAndExchangeVolatile(Void.class, "foo", "foo");
String x = (String) vh.compareAndExchange(Void.class, "foo", "foo");
});
checkCCE(() -> { // expected reference class
String x = (String) vh.compareAndExchangeVolatile(recv, Void.class, "foo");
String x = (String) vh.compareAndExchange(recv, Void.class, "foo");
});
checkCCE(() -> { // actual reference class
String x = (String) vh.compareAndExchangeVolatile(recv, "foo", Void.class);
String x = (String) vh.compareAndExchange(recv, "foo", Void.class);
});
checkWMTE(() -> { // reciever primitive class
String x = (String) vh.compareAndExchangeVolatile(0, "foo", "foo");
String x = (String) vh.compareAndExchange(0, "foo", "foo");
});
// Incorrect return type
checkCCE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, "foo", "foo");
Void r = (Void) vh.compareAndExchange(recv, "foo", "foo");
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(recv, "foo", "foo");
boolean x = (boolean) vh.compareAndExchange(recv, "foo", "foo");
});
// Incorrect arity
checkWMTE(() -> { // 0
String x = (String) vh.compareAndExchangeVolatile();
String x = (String) vh.compareAndExchange();
});
checkWMTE(() -> { // >
String x = (String) vh.compareAndExchangeVolatile(recv, "foo", "foo", Void.class);
String x = (String) vh.compareAndExchange(recv, "foo", "foo", Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
String x = (String) vh.compareAndExchangeAcquire(null, "foo", "foo");
@ -957,27 +957,27 @@ public class VarHandleTestMethodTypeString extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkCCE(() -> { // expected reference class
String x = (String) vh.compareAndExchangeVolatile(Void.class, "foo");
String x = (String) vh.compareAndExchange(Void.class, "foo");
});
checkCCE(() -> { // actual reference class
String x = (String) vh.compareAndExchangeVolatile("foo", Void.class);
String x = (String) vh.compareAndExchange("foo", Void.class);
});
// Incorrect return type
checkCCE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile("foo", "foo");
Void r = (Void) vh.compareAndExchange("foo", "foo");
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile("foo", "foo");
boolean x = (boolean) vh.compareAndExchange("foo", "foo");
});
// Incorrect arity
checkWMTE(() -> { // 0
String x = (String) vh.compareAndExchangeVolatile();
String x = (String) vh.compareAndExchange();
});
checkWMTE(() -> { // >
String x = (String) vh.compareAndExchangeVolatile("foo", "foo", Void.class);
String x = (String) vh.compareAndExchange("foo", "foo", Void.class);
});
@ -1539,39 +1539,39 @@ public class VarHandleTestMethodTypeString extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
String x = (String) vh.compareAndExchangeVolatile(null, 0, "foo", "foo");
String x = (String) vh.compareAndExchange(null, 0, "foo", "foo");
});
checkCCE(() -> { // array reference class
String x = (String) vh.compareAndExchangeVolatile(Void.class, 0, "foo", "foo");
String x = (String) vh.compareAndExchange(Void.class, 0, "foo", "foo");
});
checkCCE(() -> { // expected reference class
String x = (String) vh.compareAndExchangeVolatile(array, 0, Void.class, "foo");
String x = (String) vh.compareAndExchange(array, 0, Void.class, "foo");
});
checkCCE(() -> { // actual reference class
String x = (String) vh.compareAndExchangeVolatile(array, 0, "foo", Void.class);
String x = (String) vh.compareAndExchange(array, 0, "foo", Void.class);
});
checkWMTE(() -> { // array primitive class
String x = (String) vh.compareAndExchangeVolatile(0, 0, "foo", "foo");
String x = (String) vh.compareAndExchange(0, 0, "foo", "foo");
});
checkWMTE(() -> { // index reference class
String x = (String) vh.compareAndExchangeVolatile(array, Void.class, "foo", "foo");
String x = (String) vh.compareAndExchange(array, Void.class, "foo", "foo");
});
// Incorrect return type
checkCCE(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, "foo", "foo");
Void r = (Void) vh.compareAndExchange(array, 0, "foo", "foo");
});
checkWMTE(() -> { // primitive class
boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, "foo", "foo");
boolean x = (boolean) vh.compareAndExchange(array, 0, "foo", "foo");
});
// Incorrect arity
checkWMTE(() -> { // 0
String x = (String) vh.compareAndExchangeVolatile();
String x = (String) vh.compareAndExchange();
});
checkWMTE(() -> { // >
String x = (String) vh.compareAndExchangeVolatile(array, 0, "foo", "foo", Void.class);
String x = (String) vh.compareAndExchange(array, 0, "foo", "foo", Void.class);
});

View File

@ -101,7 +101,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
#if[CAS]
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -111,7 +111,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
#else[CAS]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -283,7 +283,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value2$);
$type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
});
checkUOE(() -> {
@ -377,7 +377,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile($value1$, $value2$);
$type$ r = ($type$) vh.compareAndExchange($value1$, $value2$);
});
checkUOE(() -> {
@ -470,17 +470,17 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) vh.get(recv);
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) vh.get(recv);
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{
@ -580,7 +580,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value2$);
$type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
});
checkUOE(() -> {
@ -673,17 +673,17 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile($value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange($value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) vh.get();
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile($value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange($value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) vh.get();
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{
@ -783,7 +783,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile($value1$, $value2$);
$type$ r = ($type$) vh.compareAndExchange($value1$, $value2$);
});
checkUOE(() -> {
@ -879,17 +879,17 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{
@ -993,7 +993,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value1$, $value2$);
$type$ r = ($type$) vh.compareAndExchange(array, i, $value1$, $value2$);
});
checkUOE(() -> {
@ -1080,7 +1080,7 @@ public class VarHandleTestAccess$Type$ extends VarHandleBaseTest {
});
checkIOOBE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, $value2$, $value1$);
$type$ r = ($type$) vh.compareAndExchange(array, ci, $value2$, $value1$);
});
checkIOOBE(() -> {

View File

@ -90,7 +90,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
#if[CAS]
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -100,7 +100,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
#else[CAS]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@ -207,7 +207,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -281,7 +281,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkROBE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkROBE(() -> {
@ -318,7 +318,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -375,7 +375,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkUOE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkUOE(() -> {
@ -465,7 +465,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -561,7 +561,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkIOOBE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkIOOBE(() -> {
@ -648,7 +648,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -738,7 +738,7 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
});
checkISE(() -> {
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
$type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
});
checkISE(() -> {
@ -844,17 +844,17 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, VALUE_1, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, VALUE_1, "failing compareAndExchange $type$ value");
}
{
@ -1006,17 +1006,17 @@ public class VarHandleTestByteArrayAs$Type$ extends VarHandleBaseByteArrayTest {
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
assertEquals(r, VALUE_2, "success compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_1, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, VALUE_1, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
assertEquals(r, VALUE_1, "failing compareAndExchange $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, VALUE_1, "failing compareAndExchange $type$ value");
}
{

View File

@ -167,17 +167,17 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{
@ -350,17 +350,17 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact($value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact($value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact($value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact($value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{
@ -536,17 +536,17 @@ public class VarHandleTestMethodHandleAccess$Type$ extends VarHandleBaseTest {
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, $value2$, $value1$);
assertEquals(r, $value2$, "success compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "success compareAndExchange $type$ value");
}
{
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
$type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, $value2$, $value3$);
assertEquals(r, $value1$, "failing compareAndExchange $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
}
{

View File

@ -455,40 +455,40 @@ public class VarHandleTestMethodType$Type$ extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
$type$ x = ($type$) vh.compareAndExchangeVolatile(null, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(null, $value1$, $value1$);
});
checkCCE(() -> { // receiver reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // expected reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(recv, Void.class, $value1$);
$type$ x = ($type$) vh.compareAndExchange(recv, Void.class, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // actual reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange(recv, $value1$, Void.class);
});
checkWMTE(() -> { // reciever primitive class
$type$ x = ($type$) vh.compareAndExchangeVolatile(0, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(0, $value1$, $value1$);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(recv, $value1$, $value1$);
Void r = (Void) vh.compareAndExchange(recv, $value1$, $value1$);
});
checkWMTE(() -> { // primitive class
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile(recv, $value1$, $value1$);
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(recv, $value1$, $value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
$type$ x = ($type$) vh.compareAndExchangeVolatile();
$type$ x = ($type$) vh.compareAndExchange();
});
checkWMTE(() -> { // >
$type$ x = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange(recv, $value1$, $value1$, Void.class);
});
// CompareAndExchangeVolatileAcquire
// CompareAndExchangeAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
$type$ x = ($type$) vh.compareAndExchangeAcquire(null, $value1$, $value1$);
@ -1060,27 +1060,27 @@ public class VarHandleTestMethodType$Type$ extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
check{#if[String]?CCE:WMTE}(() -> { // expected reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, $value1$);
$type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // actual reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile($value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange($value1$, Void.class);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile($value1$, $value1$);
Void r = (Void) vh.compareAndExchange($value1$, $value1$);
});
checkWMTE(() -> { // primitive class
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile($value1$, $value1$);
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange($value1$, $value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
$type$ x = ($type$) vh.compareAndExchangeVolatile();
$type$ x = ($type$) vh.compareAndExchange();
});
checkWMTE(() -> { // >
$type$ x = ($type$) vh.compareAndExchangeVolatile($value1$, $value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange($value1$, $value1$, Void.class);
});
@ -1715,39 +1715,39 @@ public class VarHandleTestMethodType$Type$ extends VarHandleBaseTest {
});
// CompareAndExchangeVolatile
// CompareAndExchange
// Incorrect argument types
checkNPE(() -> { // null receiver
$type$ x = ($type$) vh.compareAndExchangeVolatile(null, 0, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(null, 0, $value1$, $value1$);
});
checkCCE(() -> { // array reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, 0, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(Void.class, 0, $value1$, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // expected reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, Void.class, $value1$);
$type$ x = ($type$) vh.compareAndExchange(array, 0, Void.class, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // actual reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, $value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, Void.class);
});
checkWMTE(() -> { // array primitive class
$type$ x = ($type$) vh.compareAndExchangeVolatile(0, 0, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(0, 0, $value1$, $value1$);
});
checkWMTE(() -> { // index reference class
$type$ x = ($type$) vh.compareAndExchangeVolatile(array, Void.class, $value1$, $value1$);
$type$ x = ($type$) vh.compareAndExchange(array, Void.class, $value1$, $value1$);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
Void r = (Void) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$);
Void r = (Void) vh.compareAndExchange(array, 0, $value1$, $value1$);
});
checkWMTE(() -> { // primitive class
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$);
$wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(array, 0, $value1$, $value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
$type$ x = ($type$) vh.compareAndExchangeVolatile();
$type$ x = ($type$) vh.compareAndExchange();
});
checkWMTE(() -> { // >
$type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$, Void.class);
$type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, $value1$, Void.class);
});