diff --git a/android/guava/src/com/google/common/collect/ImmutableMap.java b/android/guava/src/com/google/common/collect/ImmutableMap.java index 5c1ca77ca01f..a25c423385dc 100644 --- a/android/guava/src/com/google/common/collect/ImmutableMap.java +++ b/android/guava/src/com/google/common/collect/ImmutableMap.java @@ -25,6 +25,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.errorprone.annotations.concurrent.LazyInit; +import com.google.j2objc.annotations.RetainedWith; import com.google.j2objc.annotations.WeakOuter; import java.io.Serializable; import java.util.AbstractMap; @@ -537,7 +538,7 @@ public ImmutableSet> entrySet() { abstract ImmutableSet> createEntrySet(); - @LazyInit private transient ImmutableSet keySet; + @LazyInit @RetainedWith private transient ImmutableSet keySet; /** * Returns an immutable set of the keys in this map, in the same order that they appear in {@link diff --git a/android/guava/src/com/google/common/collect/ImmutableMapKeySet.java b/android/guava/src/com/google/common/collect/ImmutableMapKeySet.java index 2b78941e7201..77babc276e5d 100644 --- a/android/guava/src/com/google/common/collect/ImmutableMapKeySet.java +++ b/android/guava/src/com/google/common/collect/ImmutableMapKeySet.java @@ -18,7 +18,6 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; -import com.google.j2objc.annotations.Weak; import java.io.Serializable; import org.checkerframework.checker.nullness.compatqual.NullableDecl; @@ -30,7 +29,7 @@ */ @GwtCompatible(emulated = true) final class ImmutableMapKeySet extends IndexedImmutableSet { - @Weak private final ImmutableMap map; + private final ImmutableMap map; ImmutableMapKeySet(ImmutableMap map) { this.map = map; diff --git a/guava/src/com/google/common/collect/ImmutableMap.java b/guava/src/com/google/common/collect/ImmutableMap.java index 00a789219a16..0f6562b92ec0 100644 --- a/guava/src/com/google/common/collect/ImmutableMap.java +++ b/guava/src/com/google/common/collect/ImmutableMap.java @@ -26,6 +26,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.errorprone.annotations.concurrent.LazyInit; +import com.google.j2objc.annotations.RetainedWith; import com.google.j2objc.annotations.WeakOuter; import java.io.Serializable; import java.util.AbstractMap; @@ -718,7 +719,7 @@ public ImmutableSet> entrySet() { abstract ImmutableSet> createEntrySet(); - @LazyInit private transient ImmutableSet keySet; + @LazyInit @RetainedWith private transient ImmutableSet keySet; /** * Returns an immutable set of the keys in this map, in the same order that they appear in {@link diff --git a/guava/src/com/google/common/collect/ImmutableMapKeySet.java b/guava/src/com/google/common/collect/ImmutableMapKeySet.java index b858023b65c2..56110a87e774 100644 --- a/guava/src/com/google/common/collect/ImmutableMapKeySet.java +++ b/guava/src/com/google/common/collect/ImmutableMapKeySet.java @@ -20,7 +20,6 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; -import com.google.j2objc.annotations.Weak; import java.io.Serializable; import java.util.Spliterator; import java.util.function.Consumer; @@ -34,7 +33,7 @@ */ @GwtCompatible(emulated = true) final class ImmutableMapKeySet extends IndexedImmutableSet { - @Weak private final ImmutableMap map; + private final ImmutableMap map; ImmutableMapKeySet(ImmutableMap map) { this.map = map; diff --git a/guava/src/com/google/common/collect/RegularImmutableMap.java b/guava/src/com/google/common/collect/RegularImmutableMap.java index d8f1fff6bbd4..f78180daee9f 100644 --- a/guava/src/com/google/common/collect/RegularImmutableMap.java +++ b/guava/src/com/google/common/collect/RegularImmutableMap.java @@ -209,7 +209,7 @@ ImmutableSet createKeySet() { @GwtCompatible(emulated = true) private static final class KeySet extends IndexedImmutableSet { - @Weak private final RegularImmutableMap map; + private final RegularImmutableMap map; KeySet(RegularImmutableMap map) { this.map = map;