aboutsummaryrefslogtreecommitdiff
path: root/guava/src/com/google/common/collect/ImmutableBiMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableBiMap.java')
-rw-r--r--guava/src/com/google/common/collect/ImmutableBiMap.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableBiMap.java b/guava/src/com/google/common/collect/ImmutableBiMap.java
index d26a32c67..d7855c34b 100644
--- a/guava/src/com/google/common/collect/ImmutableBiMap.java
+++ b/guava/src/com/google/common/collect/ImmutableBiMap.java
@@ -413,15 +413,14 @@ public abstract class ImmutableBiMap<K, V> extends ImmutableBiMapFauxverideShim<
* <p>Since the bimap is immutable, ImmutableBiMap doesn't require special logic for keeping the
* bimap and its inverse in sync during serialization, the way AbstractBiMap does.
*/
- private static class SerializedForm extends ImmutableMap.SerializedForm {
- SerializedForm(ImmutableBiMap<?, ?> bimap) {
+ private static class SerializedForm<K, V> extends ImmutableMap.SerializedForm<K, V> {
+ SerializedForm(ImmutableBiMap<K, V> bimap) {
super(bimap);
}
@Override
- Object readResolve() {
- Builder<Object, Object> builder = new Builder<>();
- return createMap(builder);
+ Builder<K, V> makeBuilder(int size) {
+ return new Builder<>(size);
}
private static final long serialVersionUID = 0;
@@ -429,6 +428,6 @@ public abstract class ImmutableBiMap<K, V> extends ImmutableBiMapFauxverideShim<
@Override
Object writeReplace() {
- return new SerializedForm(this);
+ return new SerializedForm<>(this);
}
}