Skip to content

Commit 0bacca2

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Copy more @CanIgnoreReturnValue annotations to GWT emulations.
RELNOTES=n/a PiperOrigin-RevId: 461928636
1 parent f5b5c20 commit 0bacca2

File tree

2 files changed

+7
-0
lines changed
  • guava-gwt/src-super/com/google/common

2 files changed

+7
-0
lines changed

guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/MapMaker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.common.base.Preconditions.checkArgument;
2020

21+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
2122
import java.util.concurrent.ConcurrentHashMap;
2223
import java.util.concurrent.ConcurrentMap;
2324

@@ -31,6 +32,7 @@ public final class MapMaker {
3132

3233
public MapMaker() {}
3334

35+
@CanIgnoreReturnValue
3436
public MapMaker initialCapacity(int initialCapacity) {
3537
if (initialCapacity < 0) {
3638
throw new IllegalArgumentException();
@@ -39,6 +41,7 @@ public MapMaker initialCapacity(int initialCapacity) {
3941
return this;
4042
}
4143

44+
@CanIgnoreReturnValue
4245
public MapMaker concurrencyLevel(int concurrencyLevel) {
4346
checkArgument(
4447
concurrencyLevel >= 1, "concurrency level (%s) must be at least 1", concurrencyLevel);

guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ public abstract class AbstractFuture<V> extends InternalFutureFailureAccess
5151
interface Trusted<V> extends ListenableFuture<V> {}
5252

5353
abstract static class TrustedFuture<V> extends AbstractFuture<V> implements Trusted<V> {
54+
@CanIgnoreReturnValue
5455
@Override
5556
public final V get() throws InterruptedException, ExecutionException {
5657
return super.get();
5758
}
5859

60+
@CanIgnoreReturnValue
5961
@Override
6062
public final V get(long timeout, TimeUnit unit)
6163
throws InterruptedException, ExecutionException, TimeoutException {
@@ -132,12 +134,14 @@ public boolean isDone() {
132134
/*
133135
* ForwardingFluentFuture needs to override those methods, so they are not final.
134136
*/
137+
@CanIgnoreReturnValue
135138
@Override
136139
public V get() throws InterruptedException, ExecutionException {
137140
state.maybeThrowOnGet(throwable);
138141
return value;
139142
}
140143

144+
@CanIgnoreReturnValue
141145
@Override
142146
public V get(long timeout, TimeUnit unit)
143147
throws InterruptedException, ExecutionException, TimeoutException {

0 commit comments

Comments
 (0)