Skip to content

Commit

Permalink
Add @ElementTypesAreNonnullByDefault to ListenableFuture.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 399328921
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Sep 28, 2021
1 parent 7a603a9 commit a1d285f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
Expand Up @@ -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<V extends @Nullable Object> extends Future<V> {
/**
* Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.
Expand Down
Expand Up @@ -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<V extends @Nullable Object> extends Future<V> {
/**
* Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.
Expand Down
Expand Up @@ -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<V extends @Nullable Object> extends Future<V> {
/**
* Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.
Expand Down

0 comments on commit a1d285f

Please sign in to comment.