diff options
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableSortedMultiset.java')
-rw-r--r-- | guava/src/com/google/common/collect/ImmutableSortedMultiset.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java index 0638df04e..d2991bce9 100644 --- a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java +++ b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java @@ -18,9 +18,12 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.GwtIncompatible; +import com.google.common.annotations.J2ktIncompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.errorprone.annotations.DoNotCall; import com.google.errorprone.annotations.concurrent.LazyInit; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.util.Arrays; import java.util.Collection; @@ -417,7 +420,7 @@ public abstract class ImmutableSortedMultiset<E> extends ImmutableSortedMultiset * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6468354">bug 6468354</a>. */ public static <E extends Comparable<?>> Builder<E> reverseOrder() { - return new Builder<E>(Ordering.natural().reverse()); + return new Builder<E>(Ordering.<E>natural().reverse()); } /** @@ -563,6 +566,7 @@ public abstract class ImmutableSortedMultiset<E> extends ImmutableSortedMultiset } } + @J2ktIncompatible // serialization private static final class SerializedForm<E> implements Serializable { final Comparator<? super E> comparator; final E[] elements; @@ -593,7 +597,13 @@ public abstract class ImmutableSortedMultiset<E> extends ImmutableSortedMultiset } @Override + @J2ktIncompatible // serialization Object writeReplace() { return new SerializedForm<E>(this); } + + @J2ktIncompatible // java.io.ObjectInputStream + private void readObject(ObjectInputStream stream) throws InvalidObjectException { + throw new InvalidObjectException("Use SerializedForm"); + } } |