Skip to content

Commit

Permalink
Remove @Beta from Futures.
Browse files Browse the repository at this point in the history
Fixes #3403 #1519 #1421 #3424

RELNOTES=`concurrent`: Remove `@Beta` from `Futures`.
PiperOrigin-RevId: 523465435
  • Loading branch information
kluever authored and Google Java Core Libraries committed Apr 11, 2023
1 parent aadc99d commit 15a0c9f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
18 changes: 0 additions & 18 deletions android/guava/src/com/google/common/util/concurrent/Futures.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly;
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 @@ -283,7 +282,6 @@ public void run() {
* @param executor the executor that runs {@code fallback} if {@code input} fails
* @since 19.0
*/
@Beta
@J2ktIncompatible
@Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class")
public static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V> catching(
Expand Down Expand Up @@ -349,7 +347,6 @@ public void run() {
* @param executor the executor that runs {@code fallback} if {@code input} fails
* @since 19.0 (similar functionality in 14.0 as {@code withFallback})
*/
@Beta
@J2ktIncompatible
@Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class")
public static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V> catchingAsync(
Expand All @@ -371,7 +368,6 @@ public void run() {
* @param scheduledExecutor The executor service to enforce the timeout.
* @since 19.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible // java.util.concurrent.ScheduledExecutorService
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
Expand Down Expand Up @@ -418,7 +414,6 @@ public void run() {
* input's failure (if not)
* @since 19.0 (in 11.0 as {@code transform})
*/
@Beta
public static <I extends @Nullable Object, O extends @Nullable Object>
ListenableFuture<O> transformAsync(
ListenableFuture<I> input,
Expand Down Expand Up @@ -456,7 +451,6 @@ ListenableFuture<O> transformAsync(
* @return A future that holds result of the transformation.
* @since 9.0 (in 2.0 as {@code compose})
*/
@Beta
public static <I extends @Nullable Object, O extends @Nullable Object>
ListenableFuture<O> transform(
ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) {
Expand All @@ -483,7 +477,6 @@ ListenableFuture<O> transform(
* @return A future that returns the result of the transformation.
* @since 10.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible // TODO
public static <I extends @Nullable Object, O extends @Nullable Object> Future<O> lazyTransform(
Expand Down Expand Up @@ -544,7 +537,6 @@ private O applyTransformation(I input) throws ExecutionException {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> ListenableFuture<List<V>> allAsList(
ListenableFuture<? extends V>... futures) {
Expand Down Expand Up @@ -572,7 +564,6 @@ private O applyTransformation(I input) throws ExecutionException {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
public static <V extends @Nullable Object> ListenableFuture<List<V>> allAsList(
Iterable<? extends ListenableFuture<? extends V>> futures) {
ListenableFuture<List<@Nullable V>> nullable =
Expand All @@ -591,7 +582,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> FutureCombiner<V> whenAllComplete(
ListenableFuture<? extends V>... futures) {
Expand All @@ -606,7 +596,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
public static <V extends @Nullable Object> FutureCombiner<V> whenAllComplete(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new FutureCombiner<V>(false, ImmutableList.copyOf(futures));
Expand All @@ -619,7 +608,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> FutureCombiner<V> whenAllSucceed(
ListenableFuture<? extends V>... futures) {
Expand All @@ -633,7 +621,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
public static <V extends @Nullable Object> FutureCombiner<V> whenAllSucceed(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new FutureCombiner<V>(true, ImmutableList.copyOf(futures));
Expand Down Expand Up @@ -665,7 +652,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@GwtCompatible
public static final class FutureCombiner<V extends @Nullable Object> {
private final boolean allMustSucceed;
Expand Down Expand Up @@ -827,7 +813,6 @@ protected void afterDone() {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> ListenableFuture<List<@Nullable V>> successfulAsList(
ListenableFuture<? extends V>... futures) {
Expand Down Expand Up @@ -864,7 +849,6 @@ protected void afterDone() {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
public static <V extends @Nullable Object> ListenableFuture<List<@Nullable V>> successfulAsList(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new ListFuture<V>(ImmutableList.copyOf(futures), false);
Expand Down Expand Up @@ -1210,7 +1194,6 @@ public String toString() {
* does not have a suitable constructor
* @since 19.0 (in 10.0 as {@code get})
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // reflection
Expand Down Expand Up @@ -1263,7 +1246,6 @@ public String toString() {
* does not have a suitable constructor
* @since 19.0 (in 10.0 as {@code get} and with different parameter order)
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // reflection
Expand Down
20 changes: 0 additions & 20 deletions guava/src/com/google/common/util/concurrent/Futures.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly;
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 @@ -299,7 +298,6 @@ public void run() {
* @param executor the executor that runs {@code fallback} if {@code input} fails
* @since 19.0
*/
@Beta
@J2ktIncompatible
@Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class")
public static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V> catching(
Expand Down Expand Up @@ -365,7 +363,6 @@ public void run() {
* @param executor the executor that runs {@code fallback} if {@code input} fails
* @since 19.0 (similar functionality in 14.0 as {@code withFallback})
*/
@Beta
@J2ktIncompatible
@Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class")
public static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V> catchingAsync(
Expand All @@ -387,7 +384,6 @@ public void run() {
* @param scheduledExecutor The executor service to enforce the timeout.
* @since 28.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible // java.util.concurrent.ScheduledExecutorService
public static <V extends @Nullable Object> ListenableFuture<V> withTimeout(
Expand All @@ -407,7 +403,6 @@ public void run() {
* @param scheduledExecutor The executor service to enforce the timeout.
* @since 19.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible // java.util.concurrent.ScheduledExecutorService
@SuppressWarnings("GoodTime") // should accept a java.time.Duration
Expand Down Expand Up @@ -454,7 +449,6 @@ public void run() {
* input's failure (if not)
* @since 19.0 (in 11.0 as {@code transform})
*/
@Beta
public static <I extends @Nullable Object, O extends @Nullable Object>
ListenableFuture<O> transformAsync(
ListenableFuture<I> input,
Expand Down Expand Up @@ -492,7 +486,6 @@ ListenableFuture<O> transformAsync(
* @return A future that holds result of the transformation.
* @since 9.0 (in 2.0 as {@code compose})
*/
@Beta
public static <I extends @Nullable Object, O extends @Nullable Object>
ListenableFuture<O> transform(
ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) {
Expand All @@ -519,7 +512,6 @@ ListenableFuture<O> transform(
* @return A future that returns the result of the transformation.
* @since 10.0
*/
@Beta
@J2ktIncompatible
@GwtIncompatible // TODO
public static <I extends @Nullable Object, O extends @Nullable Object> Future<O> lazyTransform(
Expand Down Expand Up @@ -580,7 +572,6 @@ private O applyTransformation(I input) throws ExecutionException {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> ListenableFuture<List<V>> allAsList(
ListenableFuture<? extends V>... futures) {
Expand Down Expand Up @@ -608,7 +599,6 @@ private O applyTransformation(I input) throws ExecutionException {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
public static <V extends @Nullable Object> ListenableFuture<List<V>> allAsList(
Iterable<? extends ListenableFuture<? extends V>> futures) {
ListenableFuture<List<@Nullable V>> nullable =
Expand All @@ -627,7 +617,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> FutureCombiner<V> whenAllComplete(
ListenableFuture<? extends V>... futures) {
Expand All @@ -642,7 +631,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
public static <V extends @Nullable Object> FutureCombiner<V> whenAllComplete(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new FutureCombiner<V>(false, ImmutableList.copyOf(futures));
Expand All @@ -655,7 +643,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> FutureCombiner<V> whenAllSucceed(
ListenableFuture<? extends V>... futures) {
Expand All @@ -669,7 +656,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
public static <V extends @Nullable Object> FutureCombiner<V> whenAllSucceed(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new FutureCombiner<V>(true, ImmutableList.copyOf(futures));
Expand Down Expand Up @@ -701,7 +687,6 @@ private O applyTransformation(I input) throws ExecutionException {
*
* @since 20.0
*/
@Beta
@GwtCompatible
public static final class FutureCombiner<V extends @Nullable Object> {
private final boolean allMustSucceed;
Expand Down Expand Up @@ -863,7 +848,6 @@ protected void afterDone() {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
@SafeVarargs
public static <V extends @Nullable Object> ListenableFuture<List<@Nullable V>> successfulAsList(
ListenableFuture<? extends V>... futures) {
Expand Down Expand Up @@ -900,7 +884,6 @@ protected void afterDone() {
* @return a future that provides a list of the results of the component futures
* @since 10.0
*/
@Beta
public static <V extends @Nullable Object> ListenableFuture<List<@Nullable V>> successfulAsList(
Iterable<? extends ListenableFuture<? extends V>> futures) {
return new ListFuture<V>(ImmutableList.copyOf(futures), false);
Expand Down Expand Up @@ -1246,7 +1229,6 @@ public String toString() {
* does not have a suitable constructor
* @since 19.0 (in 10.0 as {@code get})
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // reflection
Expand Down Expand Up @@ -1299,7 +1281,6 @@ public String toString() {
* does not have a suitable constructor
* @since 28.0
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // reflection
Expand Down Expand Up @@ -1352,7 +1333,6 @@ public String toString() {
* does not have a suitable constructor
* @since 19.0 (in 10.0 as {@code get} and with different parameter order)
*/
@Beta
@CanIgnoreReturnValue
@J2ktIncompatible
@GwtIncompatible // reflection
Expand Down

0 comments on commit 15a0c9f

Please sign in to comment.