From a1d285f3c14c1c96181240ae3da5a60fbfb6bbee Mon Sep 17 00:00:00 2001 From: cpovirk Date: Mon, 27 Sep 2021 18:25:33 -0700 Subject: [PATCH] Add @ElementTypesAreNonnullByDefault to ListenableFuture. RELNOTES=n/a PiperOrigin-RevId: 399328921 --- .../common/util/concurrent/ListenableFuture.java | 10 +--------- .../common/util/concurrent/ListenableFuture.java | 10 +--------- .../common/util/concurrent/ListenableFuture.java | 10 +--------- 3 files changed, 3 insertions(+), 27 deletions(-) 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 cf0199adee0c..a8d9dd4de5f9 100644 --- a/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/ListenableFuture.java @@ -116,15 +116,7 @@ * put in a special hack for us: https://issuetracker.google.com/issues/131431257) */ @DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") -/* - * It would make sense to also annotate this class with @ElementTypesAreNonnullByDefault. However, - * it makes no difference because this class is already covered by the package-level - * @ParametersAreNonnullByDefault, and this class declares only parameters, not return types or - * fields. (Not to mention that we'll be removing all @*AreNonnullByDefault annotations after tools - * understand .) And it's fortunate that the annotation makes no difference, because - * we're seeing a breakage internally when we add that annotation :) - * - */ +@ElementTypesAreNonnullByDefault 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 cf0199adee0c..a8d9dd4de5f9 100644 --- a/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java @@ -116,15 +116,7 @@ * put in a special hack for us: https://issuetracker.google.com/issues/131431257) */ @DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") -/* - * It would make sense to also annotate this class with @ElementTypesAreNonnullByDefault. However, - * it makes no difference because this class is already covered by the package-level - * @ParametersAreNonnullByDefault, and this class declares only parameters, not return types or - * fields. (Not to mention that we'll be removing all @*AreNonnullByDefault annotations after tools - * understand .) And it's fortunate that the annotation makes no difference, because - * we're seeing a breakage internally when we add that annotation :) - * - */ +@ElementTypesAreNonnullByDefault 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/ListenableFuture.java b/guava/src/com/google/common/util/concurrent/ListenableFuture.java index cf0199adee0c..a8d9dd4de5f9 100644 --- a/guava/src/com/google/common/util/concurrent/ListenableFuture.java +++ b/guava/src/com/google/common/util/concurrent/ListenableFuture.java @@ -116,15 +116,7 @@ * put in a special hack for us: https://issuetracker.google.com/issues/131431257) */ @DoNotMock("Use the methods in Futures (like immediateFuture) or SettableFuture") -/* - * It would make sense to also annotate this class with @ElementTypesAreNonnullByDefault. However, - * it makes no difference because this class is already covered by the package-level - * @ParametersAreNonnullByDefault, and this class declares only parameters, not return types or - * fields. (Not to mention that we'll be removing all @*AreNonnullByDefault annotations after tools - * understand .) And it's fortunate that the annotation makes no difference, because - * we're seeing a breakage internally when we add that annotation :) - * - */ +@ElementTypesAreNonnullByDefault public interface ListenableFuture extends Future { /** * Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.