From e3eb652c251e8298c9df95d7ed2788f2cbb5f337 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 27 Apr 2024 11:52:05 +0000 Subject: [PATCH] 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required Reviewed-by: prappo, alanb --- .../concurrent/AbstractExecutorService.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java b/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java index f45c0036230..1b1ba4b29a0 100644 --- a/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java +++ b/src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java @@ -117,6 +117,7 @@ public abstract class AbstractExecutorService implements ExecutorService { * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ + @Override public Future submit(Runnable task) { if (task == null) throw new NullPointerException(); RunnableFuture ftask = newTaskFor(task, null); @@ -128,6 +129,7 @@ public abstract class AbstractExecutorService implements ExecutorService { * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ + @Override public Future submit(Runnable task, T result) { if (task == null) throw new NullPointerException(); RunnableFuture ftask = newTaskFor(task, result); @@ -139,6 +141,7 @@ public abstract class AbstractExecutorService implements ExecutorService { * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ + @Override public Future submit(Callable task) { if (task == null) throw new NullPointerException(); RunnableFuture ftask = newTaskFor(task); @@ -219,6 +222,14 @@ public abstract class AbstractExecutorService implements ExecutorService { } } + /** + * @throws InterruptedException {@inheritDoc} + * @throws NullPointerException {@inheritDoc} + * @throws IllegalArgumentException {@inheritDoc} + * @throws ExecutionException {@inheritDoc} + * @throws RejectedExecutionException {@inheritDoc} + */ + @Override public T invokeAny(Collection> tasks) throws InterruptedException, ExecutionException { try { @@ -229,12 +240,26 @@ public abstract class AbstractExecutorService implements ExecutorService { } } + /** + * @throws InterruptedException {@inheritDoc} + * @throws NullPointerException {@inheritDoc} + * @throws TimeoutException {@inheritDoc} + * @throws ExecutionException {@inheritDoc} + * @throws RejectedExecutionException {@inheritDoc} + */ + @Override public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return doInvokeAny(tasks, true, unit.toNanos(timeout)); } + /** + * @throws InterruptedException {@inheritDoc} + * @throws NullPointerException {@inheritDoc} + * @throws RejectedExecutionException {@inheritDoc} + */ + @Override public List> invokeAll(Collection> tasks) throws InterruptedException { if (tasks == null) @@ -260,6 +285,12 @@ public abstract class AbstractExecutorService implements ExecutorService { } } + /** + * @throws InterruptedException {@inheritDoc} + * @throws NullPointerException {@inheritDoc} + * @throws RejectedExecutionException {@inheritDoc} + */ + @Override public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException {