Skip to content

Commit f418e6e

Browse files
committed
Polishing
1 parent 5e2b9b6 commit f418e6e

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@
4545
* also necessary for loading EhCache configuration from a non-default config location.
4646
*
4747
* <p>Note: As of Spring 4.0, Spring's EhCache support requires EhCache 2.1 or higher.
48-
* We recommend the use of EhCache 2.5 or higher.
48+
* We strongly recommend the use of EhCache 2.5 or higher.
4949
*
5050
* @author Juergen Hoeller
5151
* @author Dmitriy Kopylenko
@@ -132,7 +132,7 @@ public void setShared(boolean shared) {
132132

133133

134134
@Override
135-
public void afterPropertiesSet() throws IOException, CacheException {
135+
public void afterPropertiesSet() throws CacheException, IOException {
136136
logger.info("Initializing EhCache CacheManager");
137137
InputStream is = (this.configLocation != null ? this.configLocation.getInputStream() : null);
138138
try {

spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import java.util.Properties;
2121
import javax.cache.CacheManager;
2222
import javax.cache.Caching;
23-
import javax.cache.spi.CachingProvider;
2423

2524
import org.springframework.beans.factory.BeanClassLoaderAware;
2625
import org.springframework.beans.factory.DisposableBean;
@@ -75,8 +74,7 @@ public void setBeanClassLoader(ClassLoader classLoader) {
7574

7675
@Override
7776
public void afterPropertiesSet() {
78-
CachingProvider provider = Caching.getCachingProvider();
79-
this.cacheManager = provider.getCacheManager(
77+
this.cacheManager = Caching.getCachingProvider().getCacheManager(
8078
this.cacheManagerUri, this.beanClassLoader, this.cacheManagerProperties);
8179
}
8280

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void setJobSchedulingDataLocations(String... jobSchedulingDataLocations)
155155
*/
156156
public void setJobDetails(JobDetail... jobDetails) {
157157
// Use modifiable ArrayList here, to allow for further adding of
158-
// JobDetail objects during autodetection of JobDetailAwareTriggers.
158+
// JobDetail objects during autodetection of JobDetail-aware Triggers.
159159
this.jobDetails = new ArrayList<JobDetail>(Arrays.asList(jobDetails));
160160
}
161161

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ public void afterPropertiesSet() throws Exception {
476476
configTimeNonTransactionalDataSourceHolder.set(this.nonTransactionalDataSource);
477477
}
478478

479-
480479
// Get Scheduler instance from SchedulerFactory.
481480
try {
482481
this.scheduler = createScheduler(schedulerFactory, this.schedulerName);

spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,12 +46,11 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
4646
public void afterPropertiesSet() {
4747
Collection<? extends Cache> caches = loadCaches();
4848

49-
// preserve the initial order of the cache names
49+
// Preserve the initial order of the cache names
5050
this.cacheMap.clear();
5151
this.cacheNames.clear();
5252
for (Cache cache : caches) {
53-
this.cacheMap.put(cache.getName(), decorateCache(cache));
54-
this.cacheNames.add(cache.getName());
53+
addCache(cache);
5554
}
5655
}
5756

@@ -83,8 +82,9 @@ public Collection<String> getCacheNames() {
8382

8483

8584
/**
86-
* Load the caches for this cache manager. Occurs at startup.
87-
* The returned collection must not be null.
85+
* Load the initial caches for this cache manager.
86+
* <p>Called by {@link #afterPropertiesSet()} on startup.
87+
* The returned collection may be empty but must not be {@code null}.
8888
*/
8989
protected abstract Collection<? extends Cache> loadCaches();
9090

0 commit comments

Comments
 (0)