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