From ae31a1f92edfc64241fa0a3933303f8532cba73a Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 12 Sep 2024 12:43:12 -0700 Subject: [PATCH] Make errorprone's FutureReturnValueIgnored analyzer happy. --- .../analyzer/core/DatumSupplierTest.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/analyzer/javatests/com/engflow/bazel/invocation/analyzer/core/DatumSupplierTest.java b/analyzer/javatests/com/engflow/bazel/invocation/analyzer/core/DatumSupplierTest.java index 110169f..7f92dcd 100644 --- a/analyzer/javatests/com/engflow/bazel/invocation/analyzer/core/DatumSupplierTest.java +++ b/analyzer/javatests/com/engflow/bazel/invocation/analyzer/core/DatumSupplierTest.java @@ -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();