Skip to content

Commit ce06d13

Browse files
committed
Polishing
Issue: SPR-10807
1 parent 9645799 commit ce06d13

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,8 @@ public KeyGenerator getKeyGenerator() {
129129

130130
public void afterPropertiesSet() {
131131
Assert.state(this.cacheManager != null, "'cacheManager' is required");
132-
Assert.state(this.cacheOperationSource != null, "The 'cacheOperationSources' "
133-
+ "property is required: If there are no cacheable methods, "
134-
+ "then don't use a cache aspect.");
132+
Assert.state(this.cacheOperationSource != null, "The 'cacheOperationSources' property is required: " +
133+
"If there are no cacheable methods, then don't use a cache aspect.");
135134
this.initialized = true;
136135
}
137136

@@ -155,7 +154,7 @@ protected Collection<Cache> getCaches(CacheOperation operation) {
155154
Collection<Cache> caches = new ArrayList<Cache>(cacheNames.size());
156155
for (String cacheName : cacheNames) {
157156
Cache cache = this.cacheManager.getCache(cacheName);
158-
Assert.notNull(cache, "Cannot find cache named [" + cacheName + "] for " + operation);
157+
Assert.notNull(cache, "Cannot find cache named '" + cacheName + "' for " + operation);
159158
caches.add(cache);
160159
}
161160
return caches;
@@ -249,8 +248,7 @@ private void performCacheEvict(CacheOperationContext context, CacheEvictOperatio
249248
}
250249
}
251250

252-
private void logInvalidating(CacheOperationContext context,
253-
CacheEvictOperation operation, Object key) {
251+
private void logInvalidating(CacheOperationContext context, CacheEvictOperation operation, Object key) {
254252
if (this.logger.isTraceEnabled()) {
255253
this.logger.trace("Invalidating " + (key == null ? "entire cache" : "cache key " + key) +
256254
" for operation " + operation + " on method " + context.method);
@@ -326,8 +324,7 @@ public CacheOperationContexts(Collection<? extends CacheOperation> operations,
326324
Method method, Object[] args, Object target, Class<?> targetClass) {
327325

328326
for (CacheOperation operation : operations) {
329-
this.contexts.add(operation.getClass(), new CacheOperationContext(operation,
330-
method, args, target, targetClass));
327+
this.contexts.add(operation.getClass(), new CacheOperationContext(operation, method, args, target, targetClass));
331328
}
332329
}
333330

0 commit comments

Comments
 (0)