Skip to content

Commit 63db7f8

Browse files
committed
see 07/19 log
1 parent 0244975 commit 63db7f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

utilcode/src/main/java/com/blankj/utilcode/util/CacheUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class CacheUtils {
5252
public static final int HOUR = 3600;
5353
public static final int DAY = 86400;
5454

55-
private static Map<String, CacheUtils> sCacheMap = new HashMap<>();
55+
private static final Map<String, CacheUtils> CACHE_MAP = new HashMap<>();
5656
private CacheManager mCacheManager;
5757

5858
/**
@@ -131,10 +131,10 @@ public static CacheUtils getInstance(@NonNull final File cacheDir) {
131131
*/
132132
public static CacheUtils getInstance(@NonNull final File cacheDir, final long maxSize, final int maxCount) {
133133
final String cacheKey = cacheDir.getAbsoluteFile() + "_" + Process.myPid();
134-
CacheUtils cache = sCacheMap.get(cacheKey);
134+
CacheUtils cache = CACHE_MAP.get(cacheKey);
135135
if (cache == null) {
136136
cache = new CacheUtils(cacheDir, maxSize, maxCount);
137-
sCacheMap.put(cacheKey, cache);
137+
CACHE_MAP.put(cacheKey, cache);
138138
}
139139
return cache;
140140
}

utilcode/src/main/java/com/blankj/utilcode/util/SPUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public final class SPUtils {
2121

22-
private static Map<String, SPUtils> sSPMap = new HashMap<>();
22+
private static final Map<String, SPUtils> SP_MAP = new HashMap<>();
2323
private SharedPreferences sp;
2424

2525
/**
@@ -39,10 +39,10 @@ public static SPUtils getInstance() {
3939
*/
4040
public static SPUtils getInstance(String spName) {
4141
if (isSpace(spName)) spName = "spUtils";
42-
SPUtils sp = sSPMap.get(spName);
42+
SPUtils sp = SP_MAP.get(spName);
4343
if (sp == null) {
4444
sp = new SPUtils(spName);
45-
sSPMap.put(spName, sp);
45+
SP_MAP.put(spName, sp);
4646
}
4747
return sp;
4848
}

0 commit comments

Comments
 (0)