Skip to content

Commit

Permalink
Make errorprone's FutureReturnValueIgnored analyzer happy. (#185)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Peterson <benjamin@engflow.com>
  • Loading branch information
benjaminp authored Sep 12, 2024
1 parent 1d85222 commit e405d89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build --java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_language_version=17
build --tool_java_runtime_version=remotejdk_17
build --javacopt=-Xep:FutureReturnValueIgnored:ERROR

test --test_summary=testcase
test --test_output=errors
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 e405d89

Please sign in to comment.