From 183cb71663320f16149d83eeebaff7795a4b55f2 Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 27 Dec 2017 17:02:37 -0800 Subject: Remove field prefixes. Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f --- java/com/android/dialer/util/ExpirableCache.java | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'java/com/android/dialer/util/ExpirableCache.java') diff --git a/java/com/android/dialer/util/ExpirableCache.java b/java/com/android/dialer/util/ExpirableCache.java index 2778a572c..a1b0afd74 100644 --- a/java/com/android/dialer/util/ExpirableCache.java +++ b/java/com/android/dialer/util/ExpirableCache.java @@ -98,13 +98,13 @@ public class ExpirableCache { * * @see ExpirableCache.CachedValue#isExpired() */ - private final AtomicInteger mGeneration; + private final AtomicInteger generation; /** The underlying cache used to stored the cached values. */ - private LruCache> mCache; + private LruCache> cache; private ExpirableCache(LruCache> cache) { - mCache = cache; - mGeneration = new AtomicInteger(0); + this.cache = cache; + generation = new AtomicInteger(0); } /** @@ -147,7 +147,7 @@ public class ExpirableCache { * @param key the key to look up */ public CachedValue getCachedValue(K key) { - return mCache.get(key); + return cache.get(key); } /** @@ -190,7 +190,7 @@ public class ExpirableCache { * @param value the value to associate with the key */ public void put(K key, V value) { - mCache.put(key, newCachedValue(value)); + cache.put(key, newCachedValue(value)); } /** @@ -201,7 +201,7 @@ public class ExpirableCache { *

Expiring the items in the cache does not imply they will be evicted. */ public void expireAll() { - mGeneration.incrementAndGet(); + generation.incrementAndGet(); } /** @@ -210,7 +210,7 @@ public class ExpirableCache { *

Implementation of {@link LruCache#create(K)} can use this method to create a new entry. */ public CachedValue newCachedValue(V value) { - return new GenerationalCachedValue(value, mGeneration); + return new GenerationalCachedValue(value, generation); } /** @@ -239,31 +239,31 @@ public class ExpirableCache { private static class GenerationalCachedValue implements ExpirableCache.CachedValue { /** The value stored in the cache. */ - public final V mValue; + public final V value; /** The generation at which the value was added to the cache. */ - private final int mGeneration; + private final int generation; /** The atomic integer storing the current generation of the cache it belongs to. */ - private final AtomicInteger mCacheGeneration; + private final AtomicInteger cacheGeneration; /** * @param cacheGeneration the atomic integer storing the generation of the cache in which this * value will be stored */ public GenerationalCachedValue(V value, AtomicInteger cacheGeneration) { - mValue = value; - mCacheGeneration = cacheGeneration; + this.value = value; + this.cacheGeneration = cacheGeneration; // Snapshot the current generation. - mGeneration = mCacheGeneration.get(); + generation = this.cacheGeneration.get(); } @Override public V getValue() { - return mValue; + return value; } @Override public boolean isExpired() { - return mGeneration != mCacheGeneration.get(); + return generation != cacheGeneration.get(); } } } -- cgit v1.2.3