Skip to content

Commit

Permalink
Try one more @RetainedLocalRef annotation in AbstractFuture.
Browse files Browse the repository at this point in the history
Otherwise, after our call to `future.clearListeners()`, there might be nothing to keep the listeners alive. (And each time we handle and discard the head of the list, there might be nothing to keep the tail of the list alive.)

RELNOTES=n/a
PiperOrigin-RevId: 733308592
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Mar 4, 2025
1 parent 292cc2a commit 5004483
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ private static void complete(AbstractFuture<?> param, boolean callInterruptTask)
// Declare a "true" local variable so that the Checker Framework will infer nullness.
AbstractFuture<?> future = param;

Listener next = null;
@RetainedLocalRef Listener next = null;
outer:
while (true) {
future.releaseWaiters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ private static void complete(AbstractFuture<?> param, boolean callInterruptTask)
// Declare a "true" local variable so that the Checker Framework will infer nullness.
AbstractFuture<?> future = param;

Listener next = null;
@RetainedLocalRef Listener next = null;
outer:
while (true) {
future.releaseWaiters();
Expand Down

0 comments on commit 5004483

Please sign in to comment.