diff --git a/android/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java b/android/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java index e4696465d935..dc9b1d3d8bbb 100644 --- a/android/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java +++ b/android/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java @@ -18,7 +18,6 @@ import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.testing.IteratorFeature.MODIFIABLE; -import static java.util.Collections.emptyList; import com.google.common.annotations.GwtCompatible; import com.google.common.collect.ImmutableList; diff --git a/guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java b/guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java index 0b6fb02d384c..0f195dddd413 100644 --- a/guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java +++ b/guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java @@ -349,10 +349,12 @@ public long getWriteTimestamp() { return writeTimestamp; } + @Override public boolean equals(Object o) { return value.equals(o); } + @Override public int hashCode() { return value.hashCode(); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableCollection.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableCollection.java index b12b85e678de..d9c1d0bc6391 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableCollection.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableCollection.java @@ -48,6 +48,7 @@ public boolean containsAll(Collection targets) { return delegate.containsAll(targets); } + @Override public int size() { return delegate.size(); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableList.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableList.java index 7d95f7153254..64fe66ea6459 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableList.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableList.java @@ -31,18 +31,22 @@ abstract class ForwardingImmutableList extends ImmutableList { abstract List delegateList(); + @Override public int indexOf(@Nullable Object object) { return delegateList().indexOf(object); } + @Override public int lastIndexOf(@Nullable Object object) { return delegateList().lastIndexOf(object); } + @Override public E get(int index) { return delegateList().get(index); } + @Override public ImmutableList subList(int fromIndex, int toIndex) { return unsafeDelegateList(delegateList().subList(fromIndex, toIndex)); } @@ -79,6 +83,7 @@ public boolean containsAll(Collection targets) { return delegateList().containsAll(targets); } + @Override public int size() { return delegateList().size(); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableMap.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableMap.java index 7f07e1e1dcbf..68ff90ad2b31 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableMap.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ForwardingImmutableMap.java @@ -49,22 +49,27 @@ public abstract class ForwardingImmutableMap extends ImmutableMap { this.delegate = Collections.unmodifiableMap(delegate); } + @Override boolean isPartialView() { return false; } + @Override public final boolean isEmpty() { return delegate.isEmpty(); } + @Override public final boolean containsKey(@Nullable Object key) { return Maps.safeContainsKey(delegate, key); } + @Override public final boolean containsValue(@Nullable Object value) { return delegate.containsValue(value); } + @Override public @Nullable V get(@Nullable Object key) { return (key == null) ? null : Maps.safeGet(delegate, key); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java index 4a10bd16f345..767430d66cc4 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java @@ -196,6 +196,7 @@ public Builder putAll(Iterable> } @CanIgnoreReturnValue + @Override public Builder orderEntriesByValue(Comparator valueComparator) { super.orderEntriesByValue(valueComparator); return this; diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java index d6f90f2a26bb..7321b00d1960 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java @@ -39,36 +39,45 @@ public abstract class ImmutableCollection extends AbstractCollection imple ImmutableCollection() {} + @Override public abstract UnmodifiableIterator iterator(); + @Override public boolean contains(@Nullable Object object) { return object != null && super.contains(object); } + @Override public final boolean add(E e) { throw new UnsupportedOperationException(); } + @Override public final boolean remove(@Nullable Object object) { throw new UnsupportedOperationException(); } + @Override public final boolean addAll(Collection newElements) { throw new UnsupportedOperationException(); } + @Override public final boolean removeAll(Collection oldElements) { throw new UnsupportedOperationException(); } + @Override public final boolean removeIf(Predicate predicate) { throw new UnsupportedOperationException(); } + @Override public final boolean retainAll(Collection elementsToKeep) { throw new UnsupportedOperationException(); } + @Override public final void clear() { throw new UnsupportedOperationException(); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java index 149035a00a18..a3176d14a12c 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java @@ -231,18 +231,22 @@ public int lastIndexOf(@Nullable Object object) { return (object == null) ? -1 : Lists.lastIndexOfImpl(this, object); } + @Override public final boolean addAll(int index, Collection newElements) { throw new UnsupportedOperationException(); } + @Override public final E set(int index, E element) { throw new UnsupportedOperationException(); } + @Override public final void add(int index, E element) { throw new UnsupportedOperationException(); } + @Override public final E remove(int index) { throw new UnsupportedOperationException(); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java index 093848b21394..a474a915011d 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java @@ -402,18 +402,22 @@ public static ImmutableMap copyOf( abstract boolean isPartialView(); + @Override public final @Nullable V put(K k, V v) { throw new UnsupportedOperationException(); } + @Override public final @Nullable V remove(Object o) { throw new UnsupportedOperationException(); } + @Override public final void putAll(Map map) { throw new UnsupportedOperationException(); } + @Override public final void clear() { throw new UnsupportedOperationException(); } @@ -435,6 +439,7 @@ public boolean containsValue(@Nullable Object value) { private transient @Nullable ImmutableSet> cachedEntrySet = null; + @Override public final ImmutableSet> entrySet() { if (cachedEntrySet != null) { return cachedEntrySet; @@ -446,6 +451,7 @@ public final ImmutableSet> entrySet() { private transient @Nullable ImmutableSet cachedKeySet = null; + @Override public ImmutableSet keySet() { if (cachedKeySet != null) { return cachedKeySet; @@ -478,6 +484,7 @@ Spliterator keySpliterator() { private transient @Nullable ImmutableCollection cachedValues = null; + @Override public ImmutableCollection values() { if (cachedValues != null) { return cachedValues; diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java index 8ff68390b5ce..8953de2573eb 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java @@ -198,6 +198,7 @@ public ImmutableList asList() { } } + @Override ImmutableList createAsList() { return new RegularImmutableAsList(this, toArray()); } diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java index dce484fe2209..0a7ad60dfc46 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java @@ -418,14 +418,17 @@ ImmutableSortedSet createKeySet() { return ImmutableSortedSet.copyOf(comparator, sortedDelegate.keySet()); } + @Override public Comparator comparator() { return comparator; } + @Override public @Nullable K firstKey() { return sortedDelegate.firstKey(); } + @Override public @Nullable K lastKey() { return sortedDelegate.lastKey(); } @@ -441,6 +444,7 @@ public Comparator comparator() { return null; } + @Override public ImmutableSortedMap headMap(K toKey) { checkNotNull(toKey); return newView(sortedDelegate.headMap(toKey)); @@ -458,6 +462,7 @@ ImmutableSortedMap headMap(K toKey, boolean inclusive) { return headMap(toKey); } + @Override public ImmutableSortedMap subMap(K fromKey, K toKey) { checkNotNull(fromKey); checkNotNull(toKey); @@ -472,6 +477,7 @@ ImmutableSortedMap subMap(K fromKey, boolean fromInclusive, K toKey, boole return tailMap(fromKey, fromInclusive).headMap(toKey, toInclusive); } + @Override public ImmutableSortedMap tailMap(K fromKey) { checkNotNull(fromKey); return newView(sortedDelegate.tailMap(fromKey)); diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java index 11ed51e6492f..56ab76289e17 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java @@ -256,6 +256,7 @@ static ImmutableSortedSet unsafeDelegateSortedSet( this.sortedDelegate = Collections.unmodifiableSortedSet(sortedDelegate); } + @Override public Comparator comparator() { return sortedDelegate.comparator(); } @@ -310,10 +311,12 @@ public boolean containsAll(Collection targets) { } } + @Override public E first() { return sortedDelegate.first(); } + @Override public ImmutableSortedSet headSet(E toElement) { checkNotNull(toElement); try { @@ -357,10 +360,12 @@ public ImmutableSortedSet headSet(E toElement, boolean inclusive) { return headSet(toElement); } + @Override public E last() { return sortedDelegate.last(); } + @Override public ImmutableSortedSet subSet(E fromElement, E toElement) { return subSet(fromElement, true, toElement, false); } @@ -377,6 +382,7 @@ ImmutableSortedSet subSet( return tailSet(fromElement, fromInclusive).headSet(toElement, toInclusive); } + @Override public ImmutableSortedSet tailSet(E fromElement) { checkNotNull(fromElement); try { diff --git a/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java b/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java index e4696465d935..dc9b1d3d8bbb 100644 --- a/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java +++ b/guava-testlib/test/com/google/common/collect/testing/IteratorTesterTest.java @@ -18,7 +18,6 @@ import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.testing.IteratorFeature.MODIFIABLE; -import static java.util.Collections.emptyList; import com.google.common.annotations.GwtCompatible; import com.google.common.collect.ImmutableList;