--- jsr166/src/test/tck/ForkJoinTask8Test.java 2015/01/15 18:34:19 1.8 +++ jsr166/src/test/tck/ForkJoinTask8Test.java 2015/02/07 19:24:47 1.11 @@ -721,18 +721,22 @@ public class ForkJoinTask8Test extends J } /** - * invokeAll(tasks) with any null task throws NPE + * invokeAll(tasks) with any null task throws NullPointerException */ - public void testInvokeAllNPE() { + public void testInvokeAllNullTask() { RecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { AsyncFib f = new AsyncFib(8); AsyncFib g = new AsyncFib(9); - AsyncFib h = null; - try { - invokeAll(f, g, h); - shouldThrow(); - } catch (NullPointerException success) {} + AsyncFib nul = null; + Runnable[] throwingActions = { + () -> invokeAll(nul), + () -> invokeAll(nul, nul), + () -> invokeAll(f, g, nul), + () -> invokeAll(f, nul, g), + () -> invokeAll(nul, f, g), + }; + assertThrows(NullPointerException.class, throwingActions); }}; testInvokeOnPool(mainPool(), a); } @@ -1298,18 +1302,22 @@ public class ForkJoinTask8Test extends J } /** - * invokeAll(tasks) with any null task throws NPE + * invokeAll(tasks) with any null task throws NullPointerException */ - public void testInvokeAllNPESingleton() { + public void testInvokeAllNullTaskSingleton() { RecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { AsyncFib f = new AsyncFib(8); AsyncFib g = new AsyncFib(9); - AsyncFib h = null; - try { - invokeAll(f, g, h); - shouldThrow(); - } catch (NullPointerException success) {} + AsyncFib nul = null; + Runnable[] throwingActions = { + () -> invokeAll(nul), + () -> invokeAll(nul, nul), + () -> invokeAll(f, g, nul), + () -> invokeAll(f, nul, g), + () -> invokeAll(nul, f, g), + }; + assertThrows(NullPointerException.class, throwingActions); }}; testInvokeOnPool(singletonPool(), a); }