--- jsr166/src/test/tck/AtomicIntegerArray9Test.java 2016/10/11 20:38:07 1.3 +++ jsr166/src/test/tck/AtomicIntegerArray9Test.java 2019/02/22 19:27:47 1.4 @@ -25,7 +25,9 @@ public class AtomicIntegerArray9Test ext AtomicIntegerArray aa = new AtomicIntegerArray(SIZE); for (int index : new int[] { -1, SIZE }) { final int j = index; - final Runnable[] tasks = { + + assertThrows( + IndexOutOfBoundsException.class, () -> aa.getPlain(j), () -> aa.getOpaque(j), () -> aa.getAcquire(j), @@ -38,10 +40,7 @@ public class AtomicIntegerArray9Test ext () -> aa.weakCompareAndSetPlain(j, 1, 2), () -> aa.weakCompareAndSetVolatile(j, 1, 2), () -> aa.weakCompareAndSetAcquire(j, 1, 2), - () -> aa.weakCompareAndSetRelease(j, 1, 2), - }; - - assertThrows(IndexOutOfBoundsException.class, tasks); + () -> aa.weakCompareAndSetRelease(j, 1, 2)); } }