aboutsummaryrefslogtreecommitdiff
path: root/android/guava/src/com/google/common/collect/ImmutableSortedMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/guava/src/com/google/common/collect/ImmutableSortedMap.java')
-rw-r--r--android/guava/src/com/google/common/collect/ImmutableSortedMap.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/android/guava/src/com/google/common/collect/ImmutableSortedMap.java b/android/guava/src/com/google/common/collect/ImmutableSortedMap.java
index 2d3e11aac..a2f996c4a 100644
--- a/android/guava/src/com/google/common/collect/ImmutableSortedMap.java
+++ b/android/guava/src/com/google/common/collect/ImmutableSortedMap.java
@@ -24,7 +24,6 @@ import static com.google.common.collect.Maps.keyOrNull;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
-import com.google.j2objc.annotations.WeakOuter;
import java.util.AbstractMap;
import java.util.Arrays;
import java.util.Comparator;
@@ -582,7 +581,6 @@ public final class ImmutableSortedMap<K, V> extends ImmutableSortedMapFauxveride
@Override
ImmutableSet<Entry<K, V>> createEntrySet() {
- @WeakOuter
class EntrySet extends ImmutableMapEntrySet<K, V> {
@Override
public UnmodifiableIterator<Entry<K, V>> iterator() {
@@ -883,19 +881,17 @@ public final class ImmutableSortedMap<K, V> extends ImmutableSortedMapFauxveride
* are reconstructed using public factory methods. This ensures that the implementation types
* remain as implementation details.
*/
- private static class SerializedForm extends ImmutableMap.SerializedForm {
- private final Comparator<Object> comparator;
+ private static class SerializedForm<K, V> extends ImmutableMap.SerializedForm<K, V> {
+ private final Comparator<? super K> comparator;
- @SuppressWarnings("unchecked")
- SerializedForm(ImmutableSortedMap<?, ?> sortedMap) {
+ SerializedForm(ImmutableSortedMap<K, V> sortedMap) {
super(sortedMap);
- comparator = (Comparator<Object>) sortedMap.comparator();
+ comparator = sortedMap.comparator();
}
@Override
- Object readResolve() {
- Builder<Object, Object> builder = new Builder<>(comparator);
- return createMap(builder);
+ Builder<K, V> makeBuilder(int size) {
+ return new Builder<>(comparator);
}
private static final long serialVersionUID = 0;
@@ -903,7 +899,7 @@ public final class ImmutableSortedMap<K, V> extends ImmutableSortedMapFauxveride
@Override
Object writeReplace() {
- return new SerializedForm(this);
+ return new SerializedForm<>(this);
}
// This class is never actually serialized directly, but we have to make the