--- jsr166/src/test/tck/AtomicLongArray9Test.java 2016/10/11 20:38:07 1.3 +++ jsr166/src/test/tck/AtomicLongArray9Test.java 2019/02/22 19:27:47 1.4 @@ -24,7 +24,8 @@ public class AtomicLongArray9Test extend AtomicLongArray aa = new AtomicLongArray(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), @@ -37,10 +38,7 @@ public class AtomicLongArray9Test extend () -> 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)); } }