Refactor iterator of Map with Java8's Map.forEach

See gh-1459
This commit is contained in:
diguage
2017-06-13 17:53:13 +08:00
committed by Stephane Nicoll
parent 7018804e84
commit 1ef5f61ab2
18 changed files with 72 additions and 130 deletions

View File

@@ -19,7 +19,6 @@ package org.springframework.cache.caffeine;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -223,9 +222,7 @@ public class CaffeineCacheManager implements CacheManager {
* Create the known caches again with the current state of this manager.
*/
private void refreshKnownCaches() {
for (Map.Entry<String, Cache> entry : this.cacheMap.entrySet()) {
entry.setValue(createCaffeineCache(entry.getKey()));
}
this.cacheMap.forEach((key, value) -> createCaffeineCache(key));
}
}