aboutsummaryrefslogtreecommitdiff
path: root/guava/src/com/google/common/collect/ImmutableSortedAsList.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableSortedAsList.java')
-rw-r--r--guava/src/com/google/common/collect/ImmutableSortedAsList.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableSortedAsList.java b/guava/src/com/google/common/collect/ImmutableSortedAsList.java
index 91f700ece..30f19a02e 100644
--- a/guava/src/com/google/common/collect/ImmutableSortedAsList.java
+++ b/guava/src/com/google/common/collect/ImmutableSortedAsList.java
@@ -18,7 +18,7 @@ import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import java.util.Comparator;
import java.util.Spliterator;
-import org.checkerframework.checker.nullness.qual.Nullable;
+import javax.annotation.CheckForNull;
/**
* List returned by {@code ImmutableSortedSet.asList()} when the set isn't empty.
@@ -28,6 +28,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
*/
@GwtCompatible(emulated = true)
@SuppressWarnings("serial")
+@ElementTypesAreNonnullByDefault
final class ImmutableSortedAsList<E> extends RegularImmutableAsList<E>
implements SortedIterable<E> {
ImmutableSortedAsList(ImmutableSortedSet<E> backingSet, ImmutableList<E> backingList) {
@@ -49,7 +50,7 @@ final class ImmutableSortedAsList<E> extends RegularImmutableAsList<E>
@GwtIncompatible // ImmutableSortedSet.indexOf
// TODO(cpovirk): consider manual binary search under GWT to preserve O(log N) lookup
@Override
- public int indexOf(@Nullable Object target) {
+ public int indexOf(@CheckForNull Object target) {
int index = delegateCollection().indexOf(target);
// TODO(kevinb): reconsider if it's really worth making feeble attempts at
@@ -62,12 +63,12 @@ final class ImmutableSortedAsList<E> extends RegularImmutableAsList<E>
@GwtIncompatible // ImmutableSortedSet.indexOf
@Override
- public int lastIndexOf(@Nullable Object target) {
+ public int lastIndexOf(@CheckForNull Object target) {
return indexOf(target);
}
@Override
- public boolean contains(Object target) {
+ public boolean contains(@CheckForNull Object target) {
// Necessary for ISS's with comparators inconsistent with equals.
return indexOf(target) >= 0;
}