diff --git a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/BoundedLocalCacheTest.java b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/BoundedLocalCacheTest.java index d5bb64bffb..763127772a 100644 --- a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/BoundedLocalCacheTest.java +++ b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/BoundedLocalCacheTest.java @@ -142,16 +142,17 @@ public final class BoundedLocalCacheTest { @Test(dataProvider = "caches") @CacheSpec(population = Population.FULL, removalListener = Listener.MOCKITO) public void clear_pendingWrites(BoundedLocalCache cache, CacheContext context) { - var insert = new boolean[] { true }; - Mockito.doAnswer(invocation -> { - if (insert[0]) { - while (cache.writeBuffer.offer(() -> {})) { - // ignored - } - insert[0] = false; + var populate = new boolean[] { true }; + Answer fillWriteBuffer = invocation -> { + while (populate[0] && cache.writeBuffer.offer(() -> {})) { + // ignored } + populate[0] = false; return null; - }).when(context.removalListener()).onRemoval(any(), any(), any()); + }; + doAnswer(fillWriteBuffer) + .when(context.removalListener()) + .onRemoval(any(), any(), any()); cache.clear(); assertThat(cache).isExhaustivelyEmpty(); diff --git a/gradle/codeQuality.gradle b/gradle/codeQuality.gradle index 0536abd04b..ecd81efc3b 100644 --- a/gradle/codeQuality.gradle +++ b/gradle/codeQuality.gradle @@ -49,7 +49,7 @@ tasks.register('downloadCaffeineLocal') { tasks.named('javadoc').configure { options.links( - 'https://checkerframework.org/api/', + // 'https://checkerframework.org/api/', 'https://lightbend.github.io/config/latest/api/', "https://guava.dev/releases/${versions.guava}/api/docs/", "https://docs.oracle.com/en/java/javase/${JavaVersion.current().majorVersion}/docs/api/")