refactor: extract lambda to method
@@ -48,7 +48,11 @@ public class CacheContext {
public CacheInvokeContext createCacheInvokeContext(ConfigMap configMap) {
CacheInvokeContext c = newCacheInvokeContext();
- c.setCacheFunction((invokeContext, cacheAnnoConfig) -> {
+ c.setCacheFunction((cic, cac) -> createOrGetCache(cic, cac, configMap));
+ return c;
+ }
+
+ private Cache createOrGetCache(CacheInvokeContext invokeContext, CacheAnnoConfig cacheAnnoConfig, ConfigMap configMap) {
Cache cache = cacheAnnoConfig.getCache();
if (cache == null) {
if (cacheAnnoConfig instanceof CachedAnnoConfig) {
@@ -68,8 +72,6 @@ public class CacheContext {
cacheAnnoConfig.setCache(cache);
}
return cache;
- });
- return c;
}
private Cache createCacheByCachedConfig(CachedAnnoConfig ac, CacheInvokeContext invokeContext) {
