Skip to content

Commit 696f021

Browse files
authored
[Config] Add unused vars for some call sites (#7101)
The `unused` vars were added to address a warning raised by errorprone about ignoring returned types. (internal) See b/424298831
1 parent f14fc0e commit 696f021

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigAutoFetch.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.Random;
3838
import java.util.Set;
3939
import java.util.concurrent.ScheduledExecutorService;
40+
import java.util.concurrent.ScheduledFuture;
4041
import java.util.concurrent.TimeUnit;
4142
import org.json.JSONException;
4243
import org.json.JSONObject;
@@ -248,15 +249,16 @@ private void autoFetch(int remainingAttempts, long targetVersion) {
248249

249250
// Randomize fetch to occur between 0 - 4 seconds.
250251
int timeTillFetch = random.nextInt(4);
251-
scheduledExecutorService.schedule(
252-
new Runnable() {
253-
@Override
254-
public void run() {
255-
fetchLatestConfig(remainingAttempts, targetVersion);
256-
}
257-
},
258-
timeTillFetch,
259-
TimeUnit.SECONDS);
252+
ScheduledFuture<?> unused =
253+
scheduledExecutorService.schedule(
254+
new Runnable() {
255+
@Override
256+
public void run() {
257+
Task<Void> unused = fetchLatestConfig(remainingAttempts, targetVersion);
258+
}
259+
},
260+
timeTillFetch,
261+
TimeUnit.SECONDS);
260262
}
261263

262264
@VisibleForTesting

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigRealtimeHttpClient.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import java.util.Random;
5858
import java.util.Set;
5959
import java.util.concurrent.ScheduledExecutorService;
60+
import java.util.concurrent.ScheduledFuture;
6061
import java.util.concurrent.TimeUnit;
6162
import java.util.regex.Matcher;
6263
import java.util.regex.Pattern;
@@ -381,15 +382,16 @@ private synchronized void makeRealtimeHttpConnection(long retryMilliseconds) {
381382

382383
if (httpRetriesRemaining > 0) {
383384
httpRetriesRemaining--;
384-
scheduledExecutorService.schedule(
385-
new Runnable() {
386-
@Override
387-
public void run() {
388-
beginRealtimeHttpStream();
389-
}
390-
},
391-
retryMilliseconds,
392-
TimeUnit.MILLISECONDS);
385+
ScheduledFuture<?> unused =
386+
scheduledExecutorService.schedule(
387+
new Runnable() {
388+
@Override
389+
public void run() {
390+
beginRealtimeHttpStream();
391+
}
392+
},
393+
retryMilliseconds,
394+
TimeUnit.MILLISECONDS);
393395
} else if (!isInBackground) {
394396
propagateErrors(
395397
new FirebaseRemoteConfigClientException(

0 commit comments

Comments
 (0)