Use ConcurrentHashMap directly instead of MapMaker.
RELNOTES: None.
PiperOrigin-RevId: 195280015
diff --git a/src/main/java/com/google/devtools/build/lib/query2/ParallelSkyQueryUtils.java b/src/main/java/com/google/devtools/build/lib/query2/ParallelSkyQueryUtils.java
index a418f41..1e1ff15 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/ParallelSkyQueryUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/ParallelSkyQueryUtils.java
@@ -25,7 +25,6 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.ListMultimap;
-import com.google.common.collect.MapMaker;
import com.google.common.collect.Multimap;
import com.google.common.collect.Streams;
import com.google.devtools.build.lib.cmdline.Label;
@@ -56,6 +55,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.Nullable;
/**
@@ -785,7 +785,9 @@
private ThreadSafeAggregateAllSkyKeysCallback(int concurrencyLevel) {
this.results =
- Collections.newSetFromMap(new MapMaker().concurrencyLevel(concurrencyLevel).makeMap());
+ Collections.newSetFromMap(
+ new ConcurrentHashMap<>(
+ /*initialCapacity=*/ concurrencyLevel, /*loadFactor=*/ 0.75f));
}
@Override