@Override public void remove(@Nonnull Key key) { if (mCache == null) { return; } synchronized (this) { Billing.debug(TAG, "Removing entry with key=" + key + " from the cache"); mCache.remove(key); } }
@Override public void remove(@Nonnull Key key) { try { mCache.remove(key); } catch (Exception e) { Billing.error(e); } }
@Override @Nullable public Entry get(@Nonnull Key key) { if (mCache == null) { return null; } synchronized (this) { final Entry entry = mCache.get(key); if (entry == null) { Billing.debug(TAG, "Key=" + key + " is not in the cache"); return null; } final long now = currentTimeMillis(); if (now >= entry.expiresAt) { Billing.debug(TAG, "Key=" + key + " is in the cache but was expired at " + entry.expiresAt + ", now is " + now); mCache.remove(key); return null; } Billing.debug(TAG, "Key=" + key + " is in the cache"); return entry; } }