--- jsr166/src/test/tck/CompletableFutureTest.java 2013/07/22 18:25:42 1.30 +++ jsr166/src/test/tck/CompletableFutureTest.java 2013/09/09 06:48:27 1.31 @@ -2931,97 +2931,97 @@ public class CompletableFutureTest exten ThreadExecutor exec = new ThreadExecutor(); Runnable[] throwingActions = { - () -> { CompletableFuture.supplyAsync(null); }, - () -> { CompletableFuture.supplyAsync(null, exec); }, - () -> { CompletableFuture.supplyAsync(supplyOne, null); }, - - () -> { CompletableFuture.runAsync(null); }, - () -> { CompletableFuture.runAsync(null, exec); }, - () -> { CompletableFuture.runAsync(() -> {}, null); }, - - () -> { f.completeExceptionally(null); }, - - () -> { f.thenApply(null); }, - () -> { f.thenApplyAsync(null); }, - () -> { f.thenApplyAsync((x) -> x, null); }, - () -> { f.thenApplyAsync(null, exec); }, - - () -> { f.thenAccept(null); }, - () -> { f.thenAcceptAsync(null); }, - () -> { f.thenAcceptAsync((x) -> { ; }, null); }, - () -> { f.thenAcceptAsync(null, exec); }, - - () -> { f.thenRun(null); }, - () -> { f.thenRunAsync(null); }, - () -> { f.thenRunAsync(() -> { ; }, null); }, - () -> { f.thenRunAsync(null, exec); }, - - () -> { f.thenCombine(g, null); }, - () -> { f.thenCombineAsync(g, null); }, - () -> { f.thenCombineAsync(g, null, exec); }, - () -> { f.thenCombine(nullFuture, (x, y) -> x); }, - () -> { f.thenCombineAsync(nullFuture, (x, y) -> x); }, - () -> { f.thenCombineAsync(nullFuture, (x, y) -> x, exec); }, - () -> { f.thenCombineAsync(g, (x, y) -> x, null); }, - - () -> { f.thenAcceptBoth(g, null); }, - () -> { f.thenAcceptBothAsync(g, null); }, - () -> { f.thenAcceptBothAsync(g, null, exec); }, - () -> { f.thenAcceptBoth(nullFuture, (x, y) -> {}); }, - () -> { f.thenAcceptBothAsync(nullFuture, (x, y) -> {}); }, - () -> { f.thenAcceptBothAsync(nullFuture, (x, y) -> {}, exec); }, - () -> { f.thenAcceptBothAsync(g, (x, y) -> {}, null); }, - - () -> { f.runAfterBoth(g, null); }, - () -> { f.runAfterBothAsync(g, null); }, - () -> { f.runAfterBothAsync(g, null, exec); }, - () -> { f.runAfterBoth(nullFuture, () -> {}); }, - () -> { f.runAfterBothAsync(nullFuture, () -> {}); }, - () -> { f.runAfterBothAsync(nullFuture, () -> {}, exec); }, - () -> { f.runAfterBothAsync(g, () -> {}, null); }, - - () -> { f.applyToEither(g, null); }, - () -> { f.applyToEitherAsync(g, null); }, - () -> { f.applyToEitherAsync(g, null, exec); }, - () -> { f.applyToEither(nullFuture, (x) -> x); }, - () -> { f.applyToEitherAsync(nullFuture, (x) -> x); }, - () -> { f.applyToEitherAsync(nullFuture, (x) -> x, exec); }, - () -> { f.applyToEitherAsync(g, (x) -> x, null); }, - - () -> { f.acceptEither(g, null); }, - () -> { f.acceptEitherAsync(g, null); }, - () -> { f.acceptEitherAsync(g, null, exec); }, - () -> { f.acceptEither(nullFuture, (x) -> {}); }, - () -> { f.acceptEitherAsync(nullFuture, (x) -> {}); }, - () -> { f.acceptEitherAsync(nullFuture, (x) -> {}, exec); }, - () -> { f.acceptEitherAsync(g, (x) -> {}, null); }, - - () -> { f.runAfterEither(g, null); }, - () -> { f.runAfterEitherAsync(g, null); }, - () -> { f.runAfterEitherAsync(g, null, exec); }, - () -> { f.runAfterEither(nullFuture, () -> {}); }, - () -> { f.runAfterEitherAsync(nullFuture, () -> {}); }, - () -> { f.runAfterEitherAsync(nullFuture, () -> {}, exec); }, - () -> { f.runAfterEitherAsync(g, () -> {}, null); }, - - () -> { f.thenCompose(null); }, - () -> { f.thenComposeAsync(null); }, - () -> { f.thenComposeAsync(new CompletableFutureInc(), null); }, - () -> { f.thenComposeAsync(null, exec); }, - - () -> { f.exceptionally(null); }, - - () -> { f.handle(null); }, - - () -> { CompletableFuture.allOf((CompletableFuture)null); }, - () -> { CompletableFuture.allOf((CompletableFuture[])null); }, - () -> { CompletableFuture.allOf(f, null); }, - () -> { CompletableFuture.allOf(null, f); }, - - () -> { CompletableFuture.anyOf((CompletableFuture)null); }, - () -> { CompletableFuture.anyOf((CompletableFuture[])null); }, - () -> { CompletableFuture.anyOf(f, null); }, - () -> { CompletableFuture.anyOf(null, f); }, + () -> CompletableFuture.supplyAsync(null), + () -> CompletableFuture.supplyAsync(null, exec), + () -> CompletableFuture.supplyAsync(supplyOne, null), + + () -> CompletableFuture.runAsync(null), + () -> CompletableFuture.runAsync(null, exec), + () -> CompletableFuture.runAsync(() -> {}, null), + + () -> f.completeExceptionally(null), + + () -> f.thenApply(null), + () -> f.thenApplyAsync(null), + () -> f.thenApplyAsync((x) -> x, null), + () -> f.thenApplyAsync(null, exec), + + () -> f.thenAccept(null), + () -> f.thenAcceptAsync(null), + () -> f.thenAcceptAsync((x) -> {} , null), + () -> f.thenAcceptAsync(null, exec), + + () -> f.thenRun(null), + () -> f.thenRunAsync(null), + () -> f.thenRunAsync(() -> {} , null), + () -> f.thenRunAsync(null, exec), + + () -> f.thenCombine(g, null), + () -> f.thenCombineAsync(g, null), + () -> f.thenCombineAsync(g, null, exec), + () -> f.thenCombine(nullFuture, (x, y) -> x), + () -> f.thenCombineAsync(nullFuture, (x, y) -> x), + () -> f.thenCombineAsync(nullFuture, (x, y) -> x, exec), + () -> f.thenCombineAsync(g, (x, y) -> x, null), + + () -> f.thenAcceptBoth(g, null), + () -> f.thenAcceptBothAsync(g, null), + () -> f.thenAcceptBothAsync(g, null, exec), + () -> f.thenAcceptBoth(nullFuture, (x, y) -> {}), + () -> f.thenAcceptBothAsync(nullFuture, (x, y) -> {}), + () -> f.thenAcceptBothAsync(nullFuture, (x, y) -> {}, exec), + () -> f.thenAcceptBothAsync(g, (x, y) -> {}, null), + + () -> f.runAfterBoth(g, null), + () -> f.runAfterBothAsync(g, null), + () -> f.runAfterBothAsync(g, null, exec), + () -> f.runAfterBoth(nullFuture, () -> {}), + () -> f.runAfterBothAsync(nullFuture, () -> {}), + () -> f.runAfterBothAsync(nullFuture, () -> {}, exec), + () -> f.runAfterBothAsync(g, () -> {}, null), + + () -> f.applyToEither(g, null), + () -> f.applyToEitherAsync(g, null), + () -> f.applyToEitherAsync(g, null, exec), + () -> f.applyToEither(nullFuture, (x) -> x), + () -> f.applyToEitherAsync(nullFuture, (x) -> x), + () -> f.applyToEitherAsync(nullFuture, (x) -> x, exec), + () -> f.applyToEitherAsync(g, (x) -> x, null), + + () -> f.acceptEither(g, null), + () -> f.acceptEitherAsync(g, null), + () -> f.acceptEitherAsync(g, null, exec), + () -> f.acceptEither(nullFuture, (x) -> {}), + () -> f.acceptEitherAsync(nullFuture, (x) -> {}), + () -> f.acceptEitherAsync(nullFuture, (x) -> {}, exec), + () -> f.acceptEitherAsync(g, (x) -> {}, null), + + () -> f.runAfterEither(g, null), + () -> f.runAfterEitherAsync(g, null), + () -> f.runAfterEitherAsync(g, null, exec), + () -> f.runAfterEither(nullFuture, () -> {}), + () -> f.runAfterEitherAsync(nullFuture, () -> {}), + () -> f.runAfterEitherAsync(nullFuture, () -> {}, exec), + () -> f.runAfterEitherAsync(g, () -> {}, null), + + () -> f.thenCompose(null), + () -> f.thenComposeAsync(null), + () -> f.thenComposeAsync(new CompletableFutureInc(), null), + () -> f.thenComposeAsync(null, exec), + + () -> f.exceptionally(null), + + () -> f.handle(null), + + () -> CompletableFuture.allOf((CompletableFuture)null), + () -> CompletableFuture.allOf((CompletableFuture[])null), + () -> CompletableFuture.allOf(f, null), + () -> CompletableFuture.allOf(null, f), + + () -> CompletableFuture.anyOf((CompletableFuture)null), + () -> CompletableFuture.anyOf((CompletableFuture[])null), + () -> CompletableFuture.anyOf(f, null), + () -> CompletableFuture.anyOf(null, f), }; assertThrows(NullPointerException.class, throwingActions);