aboutsummaryrefslogtreecommitdiff
path: root/android/guava/src/com/google/common/collect/ImmutableSortedSet.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/guava/src/com/google/common/collect/ImmutableSortedSet.java')
-rw-r--r--android/guava/src/com/google/common/collect/ImmutableSortedSet.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/android/guava/src/com/google/common/collect/ImmutableSortedSet.java b/android/guava/src/com/google/common/collect/ImmutableSortedSet.java
index a21227deb..cf814d712 100644
--- a/android/guava/src/com/google/common/collect/ImmutableSortedSet.java
+++ b/android/guava/src/com/google/common/collect/ImmutableSortedSet.java
@@ -22,6 +22,7 @@ import static com.google.common.collect.ObjectArrays.checkElementsNotNull;
import com.google.common.annotations.GwtCompatible;
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;
@@ -627,21 +628,21 @@ public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxveride
@Override
@CheckForNull
public E lower(E e) {
- return Iterators.getNext(headSet(e, false).descendingIterator(), null);
+ return Iterators.<@Nullable E>getNext(headSet(e, false).descendingIterator(), null);
}
/** @since 12.0 */
@Override
@CheckForNull
public E floor(E e) {
- return Iterators.getNext(headSet(e, true).descendingIterator(), null);
+ return Iterators.<@Nullable E>getNext(headSet(e, true).descendingIterator(), null);
}
/** @since 12.0 */
@Override
@CheckForNull
public E ceiling(E e) {
- return Iterables.getFirst(tailSet(e, true), null);
+ return Iterables.<@Nullable E>getFirst(tailSet(e, true), null);
}
/** @since 12.0 */
@@ -649,7 +650,7 @@ public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxveride
@Override
@CheckForNull
public E higher(E e) {
- return Iterables.getFirst(tailSet(e, false), null);
+ return Iterables.<@Nullable E>getFirst(tailSet(e, false), null);
}
@Override
@@ -734,6 +735,7 @@ public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxveride
* only. This is necessary to ensure that the existence of a particular
* implementation type is an implementation detail.
*/
+ @J2ktIncompatible // serialization
private static class SerializedForm<E> implements Serializable {
final Comparator<? super E> comparator;
final Object[] elements;
@@ -751,11 +753,13 @@ public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxveride
private static final long serialVersionUID = 0;
}
+ @J2ktIncompatible // serialization
private void readObject(ObjectInputStream unused) throws InvalidObjectException {
throw new InvalidObjectException("Use SerializedForm");
}
@Override
+ @J2ktIncompatible // serialization
Object writeReplace() {
return new SerializedForm<E>(comparator, toArray());
}