提交 63db7f81 编写于 作者: B Blankj

see 07/19 log

上级 0244975d
......@@ -52,7 +52,7 @@ public class CacheUtils {
public static final int HOUR = 3600;
public static final int DAY = 86400;
private static Map<String, CacheUtils> sCacheMap = new HashMap<>();
private static final Map<String, CacheUtils> CACHE_MAP = new HashMap<>();
private CacheManager mCacheManager;
/**
......@@ -131,10 +131,10 @@ public class CacheUtils {
*/
public static CacheUtils getInstance(@NonNull final File cacheDir, final long maxSize, final int maxCount) {
final String cacheKey = cacheDir.getAbsoluteFile() + "_" + Process.myPid();
CacheUtils cache = sCacheMap.get(cacheKey);
CacheUtils cache = CACHE_MAP.get(cacheKey);
if (cache == null) {
cache = new CacheUtils(cacheDir, maxSize, maxCount);
sCacheMap.put(cacheKey, cache);
CACHE_MAP.put(cacheKey, cache);
}
return cache;
}
......
......@@ -19,7 +19,7 @@ import java.util.Set;
*/
public final class SPUtils {
private static Map<String, SPUtils> sSPMap = new HashMap<>();
private static final Map<String, SPUtils> SP_MAP = new HashMap<>();
private SharedPreferences sp;
/**
......@@ -39,10 +39,10 @@ public final class SPUtils {
*/
public static SPUtils getInstance(String spName) {
if (isSpace(spName)) spName = "spUtils";
SPUtils sp = sSPMap.get(spName);
SPUtils sp = SP_MAP.get(spName);
if (sp == null) {
sp = new SPUtils(spName);
sSPMap.put(spName, sp);
SP_MAP.put(spName, sp);
}
return sp;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册