From a3211782a6f82d589e226732a38dcd7117f103d6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 15 Jan 2013 15:54:14 +0100 Subject: [PATCH] AbstractCacheManager accepts no caches defined, allowing for EHCache default cache setup Issue: SPR-7955 --- .../cache/support/AbstractCacheManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java b/spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java index 5d301d85f4..29a5a98973 100644 --- a/spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java +++ b/spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import java.util.concurrent.ConcurrentMap; import org.springframework.beans.factory.InitializingBean; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; -import org.springframework.util.Assert; /** * Abstract base class implementing the common {@link CacheManager} methods. @@ -45,10 +44,10 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing public void afterPropertiesSet() { Collection caches = loadCaches(); - Assert.notEmpty(caches, "loadCaches must not return an empty Collection"); - this.cacheMap.clear(); // preserve the initial order of the cache names + this.cacheMap.clear(); + this.cacheNames.clear(); for (Cache cache : caches) { this.cacheMap.put(cache.getName(), decorateCache(cache)); this.cacheNames.add(cache.getName());