From ceea49e33658b73e839ea47f78b36786db63c1f5 Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Sun, 3 Apr 2016 02:11:42 -0700 Subject: [PATCH] Minor cleanup before release --- .../benmanes/caffeine/cache/BoundedLocalCache.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java index c8d4fac4b6..eb02abe9e5 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java @@ -2852,8 +2852,7 @@ final class BoundedExpireAfterAccess implements Expiration { @Override public void setExpiresAfter(long duration, TimeUnit unit) { Caffeine.requireArgument(duration >= 0); cache.setExpiresAfterAccessNanos(unit.toNanos(duration)); - cache.drainBuffersTask.reinitialize(); - cache.executor().execute(cache.drainBuffersTask); + cache.scheduleAfterWrite(); } @Override public Map oldest(int limit) { return cache.expireAfterAcessOrder(limit, transformer, true); @@ -2881,8 +2880,7 @@ final class BoundedExpireAfterWrite implements Expiration { @Override public void setExpiresAfter(long duration, TimeUnit unit) { Caffeine.requireArgument(duration >= 0); cache.setExpiresAfterWriteNanos(unit.toNanos(duration)); - cache.drainBuffersTask.reinitialize(); - cache.executor().execute(cache.drainBuffersTask); + cache.scheduleAfterWrite(); } @Override public Map oldest(int limit) { return cache.expireAfterWriteOrder(limit, transformer, true); @@ -2910,8 +2908,7 @@ final class BoundedRefreshAfterWrite implements Expiration { @Override public void setExpiresAfter(long duration, TimeUnit unit) { Caffeine.requireArgument(duration >= 0); cache.setRefreshAfterWriteNanos(unit.toNanos(duration)); - cache.drainBuffersTask.reinitialize(); - cache.executor().execute(cache.drainBuffersTask); + cache.scheduleAfterWrite(); } @SuppressWarnings("PMD.SimplifiedTernary") // false positive (#1424) @Override public Map oldest(int limit) {