< prev index next >
src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java
Print this page
@@ -1372,11 +1372,13 @@
* to be compliant with AbstractExecutorService constraints
* when used in ForkJoinPool.
*/
static final class AdaptedRunnable<T> extends ForkJoinTask<T>
implements RunnableFuture<T> {
+ @SuppressWarnings("serial") // Not statically typed as Serializable
final Runnable runnable;
+ @SuppressWarnings("serial") // Not statically typed as Serializable
T result;
AdaptedRunnable(Runnable runnable, T result) {
if (runnable == null) throw new NullPointerException();
this.runnable = runnable;
this.result = result; // OK to set this even before completion
@@ -1394,10 +1396,11 @@
/**
* Adapter for Runnables without results.
*/
static final class AdaptedRunnableAction extends ForkJoinTask<Void>
implements RunnableFuture<Void> {
+ @SuppressWarnings("serial") // Not statically typed as Serializable
final Runnable runnable;
AdaptedRunnableAction(Runnable runnable) {
if (runnable == null) throw new NullPointerException();
this.runnable = runnable;
}
@@ -1413,10 +1416,11 @@
/**
* Adapter for Runnables in which failure forces worker exception.
*/
static final class RunnableExecuteAction extends ForkJoinTask<Void> {
+ @SuppressWarnings("serial") // Not statically typed as Serializable
final Runnable runnable;
RunnableExecuteAction(Runnable runnable) {
if (runnable == null) throw new NullPointerException();
this.runnable = runnable;
}
@@ -1432,11 +1436,13 @@
/**
* Adapter for Callables.
*/
static final class AdaptedCallable<T> extends ForkJoinTask<T>
implements RunnableFuture<T> {
+ @SuppressWarnings("serial") // Not statically typed as Serializable
final Callable<? extends T> callable;
+ @SuppressWarnings("serial") // Not statically typed as Serializable
T result;
AdaptedCallable(Callable<? extends T> callable) {
if (callable == null) throw new NullPointerException();
this.callable = callable;
}
< prev index next >