Skip to content

Commit

Permalink
Make errorprone's FutureReturnValueIgnored analyzer happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Sep 12, 2024
1 parent 1d85222 commit ae31a1f
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@ public void memoizationIsThreadSafe() throws Exception {
CountDownLatch startLatch = new CountDownLatch(1);
CountDownLatch endLatch = new CountDownLatch(100);
for (int i = 0; i < 100; ++i) {
executorService.submit(
() -> {
try {
startLatch.await();
supplier.supply();
retrievalCount.getAndIncrement();
endLatch.countDown();
} catch (Throwable e) {
throw new IllegalStateException(e);
}
});
var unused =
executorService.submit(
() -> {
try {
startLatch.await();
supplier.supply();
retrievalCount.getAndIncrement();
endLatch.countDown();
} catch (Throwable e) {
throw new IllegalStateException(e);
}
});
}
startLatch.countDown();
endLatch.await();
Expand Down

0 comments on commit ae31a1f

Please sign in to comment.