24 |
|
AtomicLongArray aa = new AtomicLongArray(SIZE); |
25 |
|
for (int index : new int[] { -1, SIZE }) { |
26 |
|
final int j = index; |
27 |
< |
final Runnable[] tasks = { |
27 |
> |
assertThrows( |
28 |
> |
IndexOutOfBoundsException.class, |
29 |
|
() -> aa.getPlain(j), |
30 |
|
() -> aa.getOpaque(j), |
31 |
|
() -> aa.getAcquire(j), |
38 |
|
() -> aa.weakCompareAndSetPlain(j, 1, 2), |
39 |
|
() -> aa.weakCompareAndSetVolatile(j, 1, 2), |
40 |
|
() -> aa.weakCompareAndSetAcquire(j, 1, 2), |
41 |
< |
() -> aa.weakCompareAndSetRelease(j, 1, 2), |
41 |
< |
}; |
42 |
< |
|
43 |
< |
assertThrows(IndexOutOfBoundsException.class, tasks); |
41 |
> |
() -> aa.weakCompareAndSetRelease(j, 1, 2)); |
42 |
|
} |
43 |
|
} |
44 |
|
|