Skip to content

Commit

Permalink
Remove @Beta from various collect APIs.
Browse files Browse the repository at this point in the history
RELNOTES=`collect`: Remove `@Beta` from various `collect` APIs.
PiperOrigin-RevId: 531549473
  • Loading branch information
kluever authored and Google Java Core Libraries committed May 12, 2023
1 parent 912815e commit 98820c7
Show file tree
Hide file tree
Showing 34 changed files with 0 additions and 108 deletions.
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/ArrayTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.Collections.emptyMap;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Objects;
Expand Down Expand Up @@ -88,7 +87,6 @@
* @author Jared Levy
* @since 10.0
*/
@Beta
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public final class ArrayTable<R, C, V> extends AbstractTable<R, C, @Nullable V>
Expand Down
4 changes: 0 additions & 4 deletions android/guava/src/com/google/common/collect/Collections2.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.google.common.collect.CollectPreconditions.checkNonnegative;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
Expand Down Expand Up @@ -357,7 +356,6 @@ static StringBuilder newStringBuilderForCollection(int size) {
* @throws NullPointerException if the specified iterable is null or has any null elements.
* @since 12.0
*/
@Beta
public static <E extends Comparable<? super E>> Collection<List<E>> orderedPermutations(
Iterable<E> elements) {
return orderedPermutations(elements, Ordering.natural());
Expand Down Expand Up @@ -409,7 +407,6 @@ public static <E extends Comparable<? super E>> Collection<List<E>> orderedPermu
* the specified comparator is null.
* @since 12.0
*/
@Beta
public static <E> Collection<List<E>> orderedPermutations(
Iterable<E> elements, Comparator<? super E> comparator) {
return new OrderedPermutationCollection<E>(elements, comparator);
Expand Down Expand Up @@ -571,7 +568,6 @@ int findNextL(int j) {
* @throws NullPointerException if the specified collection is null or has any null elements.
* @since 12.0
*/
@Beta
public static <E> Collection<List<E>> permutations(Collection<E> elements) {
return new PermutationCollection<E>(ImmutableList.copyOf(elements));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.CollectPreconditions.checkNonnegative;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -120,7 +119,6 @@ public static <E> ConcurrentHashMultiset<E> create(Iterable<? extends E> element
* @throws IllegalArgumentException if {@code countMap} is not empty
* @since 20.0
*/
@Beta
public static <E> ConcurrentHashMultiset<E> create(ConcurrentMap<E, AtomicInteger> countMap) {
return new ConcurrentHashMultiset<>(countMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.errorprone.annotations.DoNotCall;
Expand Down Expand Up @@ -103,7 +102,6 @@ public static <C extends Comparable> ContiguousSet<C> create(
* @throws IllegalArgumentException if {@code lower} is greater than {@code upper}
* @since 23.0
*/
@Beta
public static ContiguousSet<Integer> closed(int lower, int upper) {
return create(Range.closed(lower, upper), DiscreteDomain.integers());
}
Expand All @@ -116,7 +114,6 @@ public static ContiguousSet<Integer> closed(int lower, int upper) {
* @throws IllegalArgumentException if {@code lower} is greater than {@code upper}
* @since 23.0
*/
@Beta
public static ContiguousSet<Long> closed(long lower, long upper) {
return create(Range.closed(lower, upper), DiscreteDomain.longs());
}
Expand All @@ -129,7 +126,6 @@ public static ContiguousSet<Long> closed(long lower, long upper) {
* @throws IllegalArgumentException if {@code lower} is greater than {@code upper}
* @since 23.0
*/
@Beta
public static ContiguousSet<Integer> closedOpen(int lower, int upper) {
return create(Range.closedOpen(lower, upper), DiscreteDomain.integers());
}
Expand All @@ -142,7 +138,6 @@ public static ContiguousSet<Integer> closedOpen(int lower, int upper) {
* @throws IllegalArgumentException if {@code lower} is greater than {@code upper}
* @since 23.0
*/
@Beta
public static ContiguousSet<Long> closedOpen(long lower, long upper) {
return create(Range.closedOpen(lower, upper), DiscreteDomain.longs());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand All @@ -44,7 +43,6 @@
* @author Kurt Alfred Kluever
* @since 15.0
*/
@Beta
@GwtCompatible
@ElementTypesAreNonnullByDefault
public final class EvictingQueue<E> extends ForwardingQueue<E> implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static com.google.common.collect.Maps.keyOrNull;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
Expand Down Expand Up @@ -359,7 +358,6 @@ public static <K, V> ImmutableSortedMap<K, V> copyOf(
* @throws IllegalArgumentException if any two keys are equal according to the comparator
* @since 19.0
*/
@Beta
public static <K, V> ImmutableSortedMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
// Hack around K not being a subtype of Comparable.
Expand All @@ -377,7 +375,6 @@ public static <K, V> ImmutableSortedMap<K, V> copyOf(
* @throws IllegalArgumentException if any two keys are equal according to the comparator
* @since 19.0
*/
@Beta
public static <K, V> ImmutableSortedMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries,
Comparator<? super K> comparator) {
Expand Down Expand Up @@ -652,7 +649,6 @@ public Builder<K, V> putAll(Map<? extends K, ? extends V> map) {
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
@Override
public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) {
super.putAll(entries);
Expand All @@ -666,7 +662,6 @@ public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>>
* @deprecated Unsupported by ImmutableSortedMap.Builder.
*/
@CanIgnoreReturnValue
@Beta
@Override
@Deprecated
@DoNotCall("Always throws UnsupportedOperationException")
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/Iterables.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.CollectPreconditions.checkRemove;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Function;
Expand Down Expand Up @@ -1053,7 +1052,6 @@ public static boolean isEmpty(Iterable<?> iterable) {
*
* @since 11.0
*/
@Beta
public static <T extends @Nullable Object> Iterable<T> mergeSorted(
final Iterable<? extends Iterable<? extends T>> iterables,
final Comparator<? super T> comparator) {
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/Iterators.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Function;
Expand Down Expand Up @@ -1295,7 +1294,6 @@ public E peek() {
*
* @since 11.0
*/
@Beta
public static <T extends @Nullable Object> UnmodifiableIterator<T> mergeSorted(
Iterable<? extends Iterator<? extends T>> iterators, Comparator<? super T> comparator) {
checkNotNull(iterators, "iterators");
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/Lists.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static com.google.common.collect.CollectPreconditions.checkNonnegative;
import static com.google.common.collect.CollectPreconditions.checkRemove;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
Expand Down Expand Up @@ -717,7 +716,6 @@ public static ImmutableList<Character> charactersOf(String string) {
* @return an {@code List<Character>} view of the character sequence
* @since 7.0
*/
@Beta
public static List<Character> charactersOf(CharSequence sequence) {
return new CharSequenceAsList(checkNotNull(sequence));
}
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/Maps.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
Expand Down Expand Up @@ -4355,7 +4354,6 @@ static <E> ImmutableMap<E, Integer> indexMap(Collection<E> list) {
*
* @since 20.0
*/
@Beta
@GwtIncompatible // NavigableMap
public static <K extends Comparable<? super K>, V extends @Nullable Object>
NavigableMap<K, V> subMap(NavigableMap<K, V> map, Range<K> range) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static com.google.common.collect.CollectPreconditions.checkRemove;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -99,7 +98,6 @@
* @author Torbjorn Gannholm
* @since 8.0
*/
@Beta
@GwtCompatible
@ElementTypesAreNonnullByDefault
public final class MinMaxPriorityQueue<E> extends AbstractQueue<E> {
Expand Down Expand Up @@ -163,7 +161,6 @@ public static Builder<Comparable> maximumSize(int maximumSize) {
* Queue<Integer>} but not a {@code Queue<Object>}).
* @since 8.0
*/
@Beta
public static final class Builder<B> {
/*
* TODO(kevinb): when the dust settles, see if we still need this or can
Expand Down
7 changes: 0 additions & 7 deletions android/guava/src/com/google/common/collect/Multisets.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static com.google.common.collect.CollectPreconditions.checkRemove;
import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
Expand Down Expand Up @@ -199,7 +198,6 @@ public boolean setCount(@ParametricNullness E element, int oldCount, int newCoun
* @return an unmodifiable view of the multiset
* @since 11.0
*/
@Beta
public static <E extends @Nullable Object> SortedMultiset<E> unmodifiableSortedMultiset(
SortedMultiset<E> sortedMultiset) {
// it's in its own file so it can be emulated for GWT
Expand Down Expand Up @@ -274,7 +272,6 @@ public ImmutableEntry<E> nextInBucket() {
*
* @since 14.0
*/
@Beta
public static <E extends @Nullable Object> Multiset<E> filter(
Multiset<E> unfiltered, Predicate<? super E> predicate) {
if (unfiltered instanceof FilteredMultiset) {
Expand Down Expand Up @@ -381,7 +378,6 @@ static int inferDistinctElements(Iterable<?> elements) {
*
* @since 14.0
*/
@Beta
public static <E extends @Nullable Object> Multiset<E> union(
final Multiset<? extends E> multiset1, final Multiset<? extends E> multiset2) {
checkNotNull(multiset1);
Expand Down Expand Up @@ -511,7 +507,6 @@ protected Entry<E> computeNext() {
*
* @since 14.0
*/
@Beta
public static <E extends @Nullable Object> Multiset<E> sum(
final Multiset<? extends E> multiset1, final Multiset<? extends E> multiset2) {
checkNotNull(multiset1);
Expand Down Expand Up @@ -589,7 +584,6 @@ protected Entry<E> computeNext() {
*
* @since 14.0
*/
@Beta
public static <E extends @Nullable Object> Multiset<E> difference(
final Multiset<E> multiset1, final Multiset<?> multiset2) {
checkNotNull(multiset1);
Expand Down Expand Up @@ -1143,7 +1137,6 @@ static int linearTimeSizeImpl(Multiset<?> multiset) {
*
* @since 11.0
*/
@Beta
public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multiset) {
Entry<E>[] entries = (Entry<E>[]) multiset.entrySet().toArray(new Entry[0]);
Arrays.sort(entries, DecreasingCount.INSTANCE);
Expand Down
3 changes: 0 additions & 3 deletions android/guava/src/com/google/common/collect/Queues.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package com.google.common.collect;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
Expand Down Expand Up @@ -283,7 +282,6 @@ public static <E> SynchronousQueue<E> newSynchronousQueue() {
* @return the number of elements transferred
* @throws InterruptedException if interrupted while waiting
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // BlockingQueue
Expand Down Expand Up @@ -332,7 +330,6 @@ public static <E> int drain(
* @param unit a {@code TimeUnit} determining how to interpret the timeout parameter
* @return the number of elements transferred
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // BlockingQueue
Expand Down
3 changes: 0 additions & 3 deletions android/guava/src/com/google/common/collect/Sets.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.CollectPreconditions.checkNonnegative;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
Expand Down Expand Up @@ -1598,7 +1597,6 @@ public String toString() {
* @throws NullPointerException if {@code set} is or contains {@code null}
* @since 23.0
*/
@Beta
public static <E> Set<Set<E>> combinations(Set<E> set, final int size) {
final ImmutableMap<E, Integer> index = Maps.indexMap(set);
checkNonnegative(size, "size");
Expand Down Expand Up @@ -2077,7 +2075,6 @@ public String toString() {
*
* @since 20.0
*/
@Beta
@GwtIncompatible // NavigableSet
public static <K extends Comparable<? super K>> NavigableSet<K> subSet(
NavigableSet<K> set, Range<K> range) {
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/SortedLists.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;
import java.util.Collections;
Expand All @@ -35,7 +34,6 @@
* @author Louis Wasserman
*/
@GwtCompatible
@Beta
@ElementTypesAreNonnullByDefault
final class SortedLists {
private SortedLists() {}
Expand Down
4 changes: 0 additions & 4 deletions android/guava/src/com/google/common/collect/Tables.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;
import com.google.common.base.Objects;
Expand Down Expand Up @@ -311,7 +310,6 @@ Iterator<Cell<C, R, V>> cellIterator() {
* @throws IllegalArgumentException if {@code backingMap} is not empty
* @since 10.0
*/
@Beta
public static <R, C, V> Table<R, C, V> newCustomTable(
Map<R, Map<C, V>> backingMap, Supplier<? extends Map<C, V>> factory) {
checkArgument(backingMap.isEmpty());
Expand Down Expand Up @@ -341,7 +339,6 @@ public static <R, C, V> Table<R, C, V> newCustomTable(
*
* @since 10.0
*/
@Beta
public static <
R extends @Nullable Object,
C extends @Nullable Object,
Expand Down Expand Up @@ -594,7 +591,6 @@ public Collection<V> values() {
* @return an unmodifiable view of the specified table
* @since 11.0
*/
@Beta
public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object>
RowSortedTable<R, C, V> unmodifiableRowSortedTable(
RowSortedTable<R, ? extends C, ? extends V> table) {
Expand Down
Loading

0 comments on commit 98820c7

Please sign in to comment.