Skip to content

Commit 4fd4440

Browse files
committed
revert some code review changes
1 parent 51aad79 commit 4fd4440

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/config/RemoteConfigManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue;
2828
import com.google.firebase.remoteconfig.RemoteConfigComponent;
2929
import java.util.Map;
30+
import java.util.Random;
3031
import java.util.concurrent.ConcurrentHashMap;
3132
import java.util.concurrent.Executor;
3233
import java.util.concurrent.LinkedBlockingQueue;
33-
import java.util.concurrent.ThreadLocalRandom;
3434
import java.util.concurrent.ThreadPoolExecutor;
3535
import java.util.concurrent.TimeUnit;
3636

@@ -50,7 +50,7 @@ public class RemoteConfigManager {
5050
TimeUnit.HOURS.toMillis(12);
5151
private static final long FETCH_NEVER_HAPPENED_TIMESTAMP_MS = 0;
5252
private static final long MIN_APP_START_CONFIG_FETCH_DELAY_MS = 5000;
53-
private static final long RANDOM_APP_START_CONFIG_FETCH_DELAY_MS = 25000;
53+
private static final int RANDOM_APP_START_CONFIG_FETCH_DELAY_MS = 25000;
5454

5555
private final ConcurrentHashMap<String, FirebaseRemoteConfigValue> allRcConfigMap;
5656
private final Executor executor;
@@ -79,7 +79,7 @@ private RemoteConfigManager() {
7979
executor,
8080
firebaseRemoteConfig,
8181
MIN_APP_START_CONFIG_FETCH_DELAY_MS
82-
+ ThreadLocalRandom.current().nextLong(RANDOM_APP_START_CONFIG_FETCH_DELAY_MS));
82+
+ new Random().nextInt(RANDOM_APP_START_CONFIG_FETCH_DELAY_MS));
8383
}
8484

8585
@VisibleForTesting

firebase-perf/src/test/java/com/google/firebase/perf/config/RemoteConfigManagerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,14 +878,14 @@ private RemoteConfigManager setupTestRemoteConfigManager(
878878
Task<Boolean> fakeTask,
879879
boolean initializeFrc,
880880
Map<String, FirebaseRemoteConfigValue> configs,
881-
long fetchDelay) {
881+
long appStartConfigFetchDelayInMs) {
882882
simulateFirebaseRemoteConfigLastFetchStatus(FirebaseRemoteConfig.LAST_FETCH_STATUS_SUCCESS);
883883
when(mockFirebaseRemoteConfig.fetchAndActivate()).thenReturn(fakeTask);
884884
when(mockFirebaseRemoteConfig.getAll()).thenReturn(configs);
885885
if (initializeFrc) {
886-
return new RemoteConfigManager(fakeExecutor, mockFirebaseRemoteConfig, fetchDelay);
886+
return new RemoteConfigManager(fakeExecutor, mockFirebaseRemoteConfig, appStartConfigFetchDelayInMs);
887887
} else {
888-
return new RemoteConfigManager(fakeExecutor, /* firebaseRemoteConfig= */ null, fetchDelay);
888+
return new RemoteConfigManager(fakeExecutor, /* firebaseRemoteConfig= */ null, appStartConfigFetchDelayInMs);
889889
}
890890
}
891891

0 commit comments

Comments
 (0)