diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Policy.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Policy.java index d4cf88dbeb..4684d599f8 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Policy.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Policy.java @@ -306,10 +306,9 @@ interface VarExpiration { /** * Associates the {@code value} with the {@code key} in this cache if the specified key is not - * already associated with a value and returns null, else returns the current value. This method - * differs from {@link Map#putIfAbsent} by substituting the configured {@link Expiry} with the - * specified write duration, has no effect on the duration if the entry was present, and does - * not return the a value. + * already associated with a value. This method differs from {@link Map#putIfAbsent} by + * substituting the configured {@link Expiry} with the specified write duration, has no effect + * on the duration if the entry was present, and returns the success rather than a value. * * @param key the key with which the specified value is to be associated * @param value value to be associated with the specified key diff --git a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/ExpireAfterVarTest.java b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/ExpireAfterVarTest.java index 7680bced9d..978f804e6d 100644 --- a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/ExpireAfterVarTest.java +++ b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/ExpireAfterVarTest.java @@ -429,7 +429,7 @@ public void putIfAbsent_present(Cache cache, CacheContext cont assertThat(cache.estimatedSize(), is(0L)); } - /* ---------------- Policy: putIfAbsent -------------- */ + /* ---------------- Policy: put -------------- */ @CheckNoWriter @CheckNoStats @Test(dataProvider = "caches", expectedExceptions = NullPointerException.class)