Skip to content

Commit

Permalink
Remove @Beta from `ImmutableFoo.Builder.builderWithExpectedSize(...…
Browse files Browse the repository at this point in the history
…)`, `orderEntriesByValue(...)`, and `Entry`-related APIs.

RELNOTES=Remove `@Beta` from `ImmutableFoo.Builder.builderWithExpectedSize(...)`, `orderEntriesByValue(...)`, and `Entry`-related APIs.
PiperOrigin-RevId: 523143868
  • Loading branch information
kluever authored and Google Java Core Libraries committed Apr 10, 2023
1 parent b3d4856 commit 61be35c
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static com.google.common.collect.CollectPreconditions.checkEntryNotNull;
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.J2ktIncompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
Expand Down Expand Up @@ -297,7 +296,6 @@ public static <K, V> Builder<K, V> builder() {
*
* @since 23.1
*/
@Beta
public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<>(expectedSize);
Expand Down Expand Up @@ -389,7 +387,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 @@ -407,7 +404,6 @@ public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>>
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
@Override
public Builder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
super.orderEntriesByValue(valueComparator);
Expand Down Expand Up @@ -515,7 +511,6 @@ public static <K, V> ImmutableBiMap<K, V> copyOf(Map<? extends K, ? extends V> m
* @throws NullPointerException if any key, value, or entry is null
* @since 19.0
*/
@Beta
public static <K, V> ImmutableBiMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
int estimatedSize =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static com.google.common.collect.ObjectArrays.checkElementsNotNull;
import static com.google.common.collect.RegularImmutableList.EMPTY;

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 @@ -702,7 +701,6 @@ public static <E> Builder<E> builder() {
*
* @since 23.1
*/
@Beta
public static <E> Builder<E> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new ImmutableList.Builder<E>(expectedSize);
Expand Down
5 changes: 0 additions & 5 deletions android/guava/src/com/google/common/collect/ImmutableMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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.annotations.J2ktIncompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
Expand Down Expand Up @@ -336,7 +335,6 @@ public static <K, V> Builder<K, V> builder() {
*
* @since 23.1
*/
@Beta
public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<>(expectedSize);
Expand Down Expand Up @@ -470,7 +468,6 @@ public Builder<K, V> putAll(Map<? extends K, ? extends V> map) {
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) {
if (entries instanceof Collection) {
ensureCapacity(size + ((Collection<?>) entries).size());
Expand All @@ -492,7 +489,6 @@ public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>>
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
public Builder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
checkState(this.valueComparator == null, "valueComparator was already set");
this.valueComparator = checkNotNull(valueComparator, "valueComparator");
Expand Down Expand Up @@ -698,7 +694,6 @@ public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> map
* @throws IllegalArgumentException if two entries have the same key
* @since 19.0
*/
@Beta
public static <K, V> ImmutableMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
int initialCapacity =
Expand Down
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/ImmutableSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static com.google.common.collect.ObjectArrays.checkElementNotNull;
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 @@ -414,7 +413,6 @@ public static <E> Builder<E> builder() {
*
* @since 23.1
*/
@Beta
public static <E> Builder<E> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<E>(expectedSize);
Expand Down
5 changes: 0 additions & 5 deletions guava/src/com/google/common/collect/ImmutableBiMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -303,7 +302,6 @@ public static <K, V> Builder<K, V> builder() {
*
* @since 23.1
*/
@Beta
public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<>(expectedSize);
Expand Down Expand Up @@ -394,7 +392,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 @@ -412,7 +409,6 @@ public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>>
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
@Override
public Builder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
super.orderEntriesByValue(valueComparator);
Expand Down Expand Up @@ -556,7 +552,6 @@ public static <K, V> ImmutableBiMap<K, V> copyOf(Map<? extends K, ? extends V> m
* @throws NullPointerException if any key, value, or entry is null
* @since 19.0
*/
@Beta
public static <K, V> ImmutableBiMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
@SuppressWarnings("unchecked") // we'll only be using getKey and getValue, which are covariant
Expand Down
2 changes: 0 additions & 2 deletions guava/src/com/google/common/collect/ImmutableList.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static com.google.common.collect.RegularImmutableList.EMPTY;
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 @@ -749,7 +748,6 @@ public static <E> Builder<E> builder() {
*
* @since 23.1
*/
@Beta
public static <E> Builder<E> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new ImmutableList.Builder<E>(expectedSize);
Expand Down
5 changes: 0 additions & 5 deletions guava/src/com/google/common/collect/ImmutableMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -362,7 +361,6 @@ public static <K, V> Builder<K, V> builder() {
*
* @since 23.1
*/
@Beta
public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<>(expectedSize);
Expand Down Expand Up @@ -488,7 +486,6 @@ public Builder<K, V> putAll(Map<? extends K, ? extends V> map) {
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) {
if (entries instanceof Collection) {
ensureCapacity(size + ((Collection<?>) entries).size());
Expand All @@ -510,7 +507,6 @@ public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>>
* @since 19.0
*/
@CanIgnoreReturnValue
@Beta
public Builder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
checkState(this.valueComparator == null, "valueComparator was already set");
this.valueComparator = checkNotNull(valueComparator, "valueComparator");
Expand Down Expand Up @@ -700,7 +696,6 @@ public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> map
* @throws IllegalArgumentException if two entries have the same key
* @since 19.0
*/
@Beta
public static <K, V> ImmutableMap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
@SuppressWarnings("unchecked") // we'll only be using getKey and getValue, which are covariant
Expand Down
2 changes: 0 additions & 2 deletions guava/src/com/google/common/collect/ImmutableSet.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.annotations.J2ktIncompatible;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -453,7 +452,6 @@ public static <E> Builder<E> builder() {
*
* @since 23.1
*/
@Beta
public static <E> Builder<E> builderWithExpectedSize(int expectedSize) {
checkNonnegative(expectedSize, "expectedSize");
return new Builder<E>(expectedSize);
Expand Down

0 comments on commit 61be35c

Please sign in to comment.