From 6c47dd66cdffe859394696259e921c9cbcad2794 Mon Sep 17 00:00:00 2001 From: oksanaevseeva Date: Fri, 14 Jul 2023 14:59:03 +0200 Subject: [PATCH] Apply the change to `android/guava/src/com/google/common/collect/Maps.java` as well --- android/guava/src/com/google/common/collect/Maps.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/guava/src/com/google/common/collect/Maps.java b/android/guava/src/com/google/common/collect/Maps.java index 9a385204730a..e753e8abaaf8 100644 --- a/android/guava/src/com/google/common/collect/Maps.java +++ b/android/guava/src/com/google/common/collect/Maps.java @@ -35,6 +35,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; +import com.google.common.collect.Collections2.FilteredCollection; import com.google.common.collect.MapDifference.ValueDifference; import com.google.common.primitives.Ints; import com.google.errorprone.annotations.CanIgnoreReturnValue; @@ -1247,7 +1248,8 @@ public static ImmutableMap toMap( @CanIgnoreReturnValue public static ImmutableMap uniqueIndex( Iterable values, Function keyFunction) { - if (values instanceof Collection) { + if (values instanceof Collection + && !(values instanceof FilteredCollection || values instanceof FilteredMultimapValues)) { return uniqueIndex( values.iterator(), keyFunction,