From 5e2eb7d0deee73e50054bf6c7344d417f6113b0a Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 22 Nov 2015 19:58:04 -0500 Subject: [PATCH] Clarify three possible outcomes in CacheTests#testCachePollution --- .../java/org/elasticsearch/common/cache/CacheTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/common/cache/CacheTests.java b/core/src/test/java/org/elasticsearch/common/cache/CacheTests.java index 8355bc44022..38090403668 100644 --- a/core/src/test/java/org/elasticsearch/common/cache/CacheTests.java +++ b/core/src/test/java/org/elasticsearch/common/cache/CacheTests.java @@ -632,7 +632,7 @@ public class CacheTests extends ESTestCase { first = random.nextBoolean(); second = random.nextBoolean(); } while (first && second); - if (first && !second) { + if (first) { try { cache.computeIfAbsent(key, k -> { if (random.nextBoolean()) { @@ -646,9 +646,9 @@ public class CacheTests extends ESTestCase { assertThat(e.getCause(), instanceOf(Exception.class)); assertEquals(e.getCause().getMessage(), "testCachePollution"); } - } else if (!first && second) { + } else if (second) { cache.invalidate(key); - } else if (!first && !second) { + } else { cache.get(key); } }