aboutsummaryrefslogtreecommitdiff
path: root/guava/src/com/google/common/collect/RegularImmutableBiMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava/src/com/google/common/collect/RegularImmutableBiMap.java')
-rw-r--r--guava/src/com/google/common/collect/RegularImmutableBiMap.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/guava/src/com/google/common/collect/RegularImmutableBiMap.java b/guava/src/com/google/common/collect/RegularImmutableBiMap.java
index 333b80177..e97a86934 100644
--- a/guava/src/com/google/common/collect/RegularImmutableBiMap.java
+++ b/guava/src/com/google/common/collect/RegularImmutableBiMap.java
@@ -25,6 +25,7 @@ import static com.google.common.collect.RegularImmutableMap.checkNoConflictInKey
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.GwtCompatible;
+import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMapEntry.NonTerminalImmutableBiMapEntry;
@@ -285,8 +286,26 @@ class RegularImmutableBiMap<K, V> extends ImmutableBiMap<K, V> {
ImmutableCollection<Entry<V, K>> delegateCollection() {
return InverseEntrySet.this;
}
+
+ // redeclare to help optimizers with b/310253115
+ @SuppressWarnings("RedundantOverride")
+ @Override
+ @J2ktIncompatible // serialization
+ @GwtIncompatible // serialization
+ Object writeReplace() {
+ return super.writeReplace();
+ }
};
}
+
+ // redeclare to help optimizers with b/310253115
+ @SuppressWarnings("RedundantOverride")
+ @Override
+ @J2ktIncompatible // serialization
+ @GwtIncompatible // serialization
+ Object writeReplace() {
+ return super.writeReplace();
+ }
}
@Override
@@ -296,6 +315,7 @@ class RegularImmutableBiMap<K, V> extends ImmutableBiMap<K, V> {
@Override
@J2ktIncompatible // serialization
+ @GwtIncompatible // serialization
Object writeReplace() {
return new InverseSerializedForm<>(RegularImmutableBiMap.this);
}
@@ -320,4 +340,13 @@ class RegularImmutableBiMap<K, V> extends ImmutableBiMap<K, V> {
private static final long serialVersionUID = 1;
}
+
+ // redeclare to help optimizers with b/310253115
+ @SuppressWarnings("RedundantOverride")
+ @Override
+ @J2ktIncompatible // serialization
+ @GwtIncompatible // serialization
+ Object writeReplace() {
+ return super.writeReplace();
+ }
}