Polishing
This commit is contained in:
@@ -19,6 +19,8 @@ package org.springframework.util.concurrent;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Extension of {@link CompletableFuture} which allows for cancelling
|
||||
* a delegate along with the {@link CompletableFuture} itself.
|
||||
@@ -30,10 +32,13 @@ class DelegatingCompletableFuture<T> extends CompletableFuture<T> {
|
||||
|
||||
private final Future<T> delegate;
|
||||
|
||||
|
||||
public DelegatingCompletableFuture(Future<T> delegate) {
|
||||
Assert.notNull(delegate, "Delegate must not be null");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean cancel(boolean mayInterruptIfRunning) {
|
||||
boolean result = this.delegate.cancel(mayInterruptIfRunning);
|
||||
|
||||
Reference in New Issue
Block a user