From add430908ec77c1859f84bd753b84a5eca57b327 Mon Sep 17 00:00:00 2001 From: jlavallee Date: Sun, 8 Dec 2019 07:47:19 -0800 Subject: [PATCH] Add @DoNotMock to ListenableFuture Remove @DoNotMock from AbstractFuture, as it is now covered by @DoNotMock on ListenableFuture RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=284433016 --- .../src/com/google/common/util/concurrent/FluentFuture.java | 2 ++ .../src/com/google/common/util/concurrent/ListenableFuture.java | 2 ++ .../src/com/google/common/util/concurrent/ListenableFuture.java | 2 ++ guava/src/com/google/common/util/concurrent/FluentFuture.java | 2 ++ .../src/com/google/common/util/concurrent/ListenableFuture.java | 2 ++ 5 files changed, 10 insertions(+) diff --git a/android/guava/src/com/google/common/util/concurrent/FluentFuture.java b/android/guava/src/com/google/common/util/concurrent/FluentFuture.java index 769f4261937a..b3e379cda37e 100644 --- a/android/guava/src/com/google/common/util/concurrent/FluentFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/FluentFuture.java @@ -21,6 +21,7 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.base.Function; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.errorprone.annotations.DoNotMock; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; @@ -69,6 +70,7 @@ * @since 23.0 */ @Beta +@DoNotMock("Use FluentFuture.from(Futures.immediate*Future) or SettableFuture") @GwtCompatible(emulated = true) public abstract class FluentFuture extends GwtFluentFutureCatchingSpecialization { diff --git a/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java b/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java index 371c5b526ce8..5a636d1acadd 100644 --- a/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java @@ -14,6 +14,7 @@ package com.google.common.util.concurrent; +import com.google.errorprone.annotations.DoNotMock; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; @@ -98,6 +99,7 @@ * @author Nishant Thakkar * @since 1.0 */ +@DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") public interface ListenableFuture extends Future { /** * Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor. diff --git a/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java b/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java index 371c5b526ce8..5a636d1acadd 100644 --- a/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java @@ -14,6 +14,7 @@ package com.google.common.util.concurrent; +import com.google.errorprone.annotations.DoNotMock; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; @@ -98,6 +99,7 @@ * @author Nishant Thakkar * @since 1.0 */ +@DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") public interface ListenableFuture extends Future { /** * Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor. diff --git a/guava/src/com/google/common/util/concurrent/FluentFuture.java b/guava/src/com/google/common/util/concurrent/FluentFuture.java index 0968dcbf6328..c286e6fe8ed6 100644 --- a/guava/src/com/google/common/util/concurrent/FluentFuture.java +++ b/guava/src/com/google/common/util/concurrent/FluentFuture.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.base.Function; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.errorprone.annotations.DoNotMock; import java.time.Duration; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; @@ -71,6 +72,7 @@ * @since 23.0 */ @Beta +@DoNotMock("Use FluentFuture.from(Futures.immediate*Future) or SettableFuture") @GwtCompatible(emulated = true) public abstract class FluentFuture extends GwtFluentFutureCatchingSpecialization { diff --git a/guava/src/com/google/common/util/concurrent/ListenableFuture.java b/guava/src/com/google/common/util/concurrent/ListenableFuture.java index 371c5b526ce8..5a636d1acadd 100644 --- a/guava/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/guava/src/com/google/common/util/concurrent/ListenableFuture.java @@ -14,6 +14,7 @@ package com.google.common.util.concurrent; +import com.google.errorprone.annotations.DoNotMock; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; @@ -98,6 +99,7 @@ * @author Nishant Thakkar * @since 1.0 */ +@DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") public interface ListenableFuture extends Future { /** * Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.