Skip to content

Commit

Permalink
Remove @CanIgnoreReturnValue from most of ForwardingFuture.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 432413913
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Mar 4, 2022
1 parent 4ddae0d commit 24c1b85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* @author Sven Mawson
* @since 1.0
*/
@CanIgnoreReturnValue // TODO(cpovirk): Consider being more strict.
@GwtCompatible
@ElementTypesAreNonnullByDefault
public abstract class ForwardingFuture<V extends @Nullable Object> extends ForwardingObject
Expand All @@ -46,6 +45,7 @@ protected ForwardingFuture() {}
protected abstract Future<? extends V> delegate();

@Override
@CanIgnoreReturnValue
public boolean cancel(boolean mayInterruptIfRunning) {
return delegate().cancel(mayInterruptIfRunning);
}
Expand All @@ -61,12 +61,14 @@ public boolean isDone() {
}

@Override
@CanIgnoreReturnValue
@ParametricNullness
public V get() throws InterruptedException, ExecutionException {
return delegate().get();
}

@Override
@CanIgnoreReturnValue
@ParametricNullness
public V get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* @author Sven Mawson
* @since 1.0
*/
@CanIgnoreReturnValue // TODO(cpovirk): Consider being more strict.
@GwtCompatible
@ElementTypesAreNonnullByDefault
public abstract class ForwardingFuture<V extends @Nullable Object> extends ForwardingObject
Expand All @@ -46,6 +45,7 @@ protected ForwardingFuture() {}
protected abstract Future<? extends V> delegate();

@Override
@CanIgnoreReturnValue
public boolean cancel(boolean mayInterruptIfRunning) {
return delegate().cancel(mayInterruptIfRunning);
}
Expand All @@ -61,12 +61,14 @@ public boolean isDone() {
}

@Override
@CanIgnoreReturnValue
@ParametricNullness
public V get() throws InterruptedException, ExecutionException {
return delegate().get();
}

@Override
@CanIgnoreReturnValue
@ParametricNullness
public V get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
Expand Down

0 comments on commit 24c1b85

Please sign in to comment.