diff --git a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
index a17adb14263..03d41232527 100644
--- a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
+++ b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2014 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.
@@ -45,7 +45,7 @@ import org.springframework.core.io.Resource;
* also necessary for loading EhCache configuration from a non-default config location.
*
*
Note: As of Spring 4.0, Spring's EhCache support requires EhCache 2.1 or higher.
- * We recommend the use of EhCache 2.5 or higher.
+ * We strongly recommend the use of EhCache 2.5 or higher.
*
* @author Juergen Hoeller
* @author Dmitriy Kopylenko
@@ -132,7 +132,7 @@ public class EhCacheManagerFactoryBean implements FactoryBean, Ini
@Override
- public void afterPropertiesSet() throws IOException, CacheException {
+ public void afterPropertiesSet() throws CacheException, IOException {
logger.info("Initializing EhCache CacheManager");
InputStream is = (this.configLocation != null ? this.configLocation.getInputStream() : null);
try {
diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java
index e8455931d03..1de64fbb42d 100644
--- a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java
+++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2014 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.
@@ -20,7 +20,6 @@ import java.net.URI;
import java.util.Properties;
import javax.cache.CacheManager;
import javax.cache.Caching;
-import javax.cache.spi.CachingProvider;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.DisposableBean;
@@ -75,8 +74,7 @@ public class JCacheManagerFactoryBean
@Override
public void afterPropertiesSet() {
- CachingProvider provider = Caching.getCachingProvider();
- this.cacheManager = provider.getCacheManager(
+ this.cacheManager = Caching.getCachingProvider().getCacheManager(
this.cacheManagerUri, this.beanClassLoader, this.cacheManagerProperties);
}
diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java
index e3d35bb54a7..428946ab947 100644
--- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java
+++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java
@@ -155,7 +155,7 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
*/
public void setJobDetails(JobDetail... jobDetails) {
// Use modifiable ArrayList here, to allow for further adding of
- // JobDetail objects during autodetection of JobDetailAwareTriggers.
+ // JobDetail objects during autodetection of JobDetail-aware Triggers.
this.jobDetails = new ArrayList(Arrays.asList(jobDetails));
}
diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java
index 4b1274bc1e9..cc8838985d8 100644
--- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java
+++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java
@@ -476,7 +476,6 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
configTimeNonTransactionalDataSourceHolder.set(this.nonTransactionalDataSource);
}
-
// Get Scheduler instance from SchedulerFactory.
try {
this.scheduler = createScheduler(schedulerFactory, this.schedulerName);
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 364472409b4..fa1acd60243 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-2013 the original author or authors.
+ * Copyright 2002-2014 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.
@@ -46,12 +46,11 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
public void afterPropertiesSet() {
Collection extends Cache> caches = loadCaches();
- // preserve the initial order of the cache names
+ // 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());
+ addCache(cache);
}
}
@@ -83,8 +82,9 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
/**
- * Load the caches for this cache manager. Occurs at startup.
- * The returned collection must not be null.
+ * Load the initial caches for this cache manager.
+ * Called by {@link #afterPropertiesSet()} on startup.
+ * The returned collection may be empty but must not be {@code null}.
*/
protected abstract Collection extends Cache> loadCaches();