aboutsummaryrefslogtreecommitdiffstats
path: root/guava/src/com/google/common/collect/EmptyImmutableSortedSet.java
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2015-01-19 12:46:40 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-19 12:46:40 +0000
commitaab56800fcb95e9b1a2d653588b14158080cc6b4 (patch)
tree7365392c3ea77742021cf187acfd465f9bb774ab /guava/src/com/google/common/collect/EmptyImmutableSortedSet.java
parent6fa98dbaae182b511fbeb331e08f5fb827715ea8 (diff)
parent84fb43aa6a1e752487f2624055ff26b1b6b7c043 (diff)
downloadandroid_external_guava-aab56800fcb95e9b1a2d653588b14158080cc6b4.tar.gz
android_external_guava-aab56800fcb95e9b1a2d653588b14158080cc6b4.tar.bz2
android_external_guava-aab56800fcb95e9b1a2d653588b14158080cc6b4.zip
am 84fb43aa: Merge "Revert "Upgraded Guava to unmodified v14.0.1""
* commit '84fb43aa6a1e752487f2624055ff26b1b6b7c043': Revert "Upgraded Guava to unmodified v14.0.1"
Diffstat (limited to 'guava/src/com/google/common/collect/EmptyImmutableSortedSet.java')
-rw-r--r--guava/src/com/google/common/collect/EmptyImmutableSortedSet.java32
1 files changed, 11 insertions, 21 deletions
diff --git a/guava/src/com/google/common/collect/EmptyImmutableSortedSet.java b/guava/src/com/google/common/collect/EmptyImmutableSortedSet.java
index 9f5d522..e406163 100644
--- a/guava/src/com/google/common/collect/EmptyImmutableSortedSet.java
+++ b/guava/src/com/google/common/collect/EmptyImmutableSortedSet.java
@@ -17,7 +17,6 @@
package com.google.common.collect;
import com.google.common.annotations.GwtCompatible;
-import com.google.common.annotations.GwtIncompatible;
import java.util.Collection;
import java.util.Comparator;
@@ -47,37 +46,33 @@ class EmptyImmutableSortedSet<E> extends ImmutableSortedSet<E> {
return true;
}
- @Override public boolean contains(@Nullable Object target) {
+ @Override public boolean contains(Object target) {
return false;
}
- @Override public boolean containsAll(Collection<?> targets) {
- return targets.isEmpty();
- }
-
@Override public UnmodifiableIterator<E> iterator() {
return Iterators.emptyIterator();
}
- @GwtIncompatible("NavigableSet")
- @Override public UnmodifiableIterator<E> descendingIterator() {
- return Iterators.emptyIterator();
- }
-
@Override boolean isPartialView() {
return false;
}
- @Override public ImmutableList<E> asList() {
- return ImmutableList.of();
- }
+ private static final Object[] EMPTY_ARRAY = new Object[0];
@Override public Object[] toArray() {
- return ObjectArrays.EMPTY_ARRAY;
+ return EMPTY_ARRAY;
}
@Override public <T> T[] toArray(T[] a) {
- return asList().toArray(a);
+ if (a.length > 0) {
+ a[0] = null;
+ }
+ return a;
+ }
+
+ @Override public boolean containsAll(Collection<?> targets) {
+ return targets.isEmpty();
}
@Override public boolean equals(@Nullable Object object) {
@@ -125,9 +120,4 @@ class EmptyImmutableSortedSet<E> extends ImmutableSortedSet<E> {
@Override int indexOf(@Nullable Object target) {
return -1;
}
-
- @Override
- ImmutableSortedSet<E> createDescendingSet() {
- return new EmptyImmutableSortedSet<E>(Ordering.from(comparator).reverse());
- }
}