/** * {@inheritDoc} * * This implementation always returns a {@link Cache} implementation that will not * store items. Additionally, the request cache will be remembered by the manager for consistency. */ public Cache getCache(String name) { Cache cache = caches.get(name); if (cache == null) { caches.putIfAbsent(name, new NoOpCache(name)); synchronized (names) { names.add(name); } } return caches.get(name); }
这是Spring的一个方法,很简单,绕过null