diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java index 270973c776..f4c2653724 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java @@ -129,9 +129,8 @@ public abstract class CacheAspectSupport implements InitializingBean { public void afterPropertiesSet() { Assert.state(this.cacheManager != null, "'cacheManager' is required"); - Assert.state(this.cacheOperationSource != null, "The 'cacheOperationSources' " - + "property is required: If there are no cacheable methods, " - + "then don't use a cache aspect."); + Assert.state(this.cacheOperationSource != null, "The 'cacheOperationSources' property is required: " + + "If there are no cacheable methods, then don't use a cache aspect."); this.initialized = true; } @@ -155,7 +154,7 @@ public abstract class CacheAspectSupport implements InitializingBean { Collection caches = new ArrayList(cacheNames.size()); for (String cacheName : cacheNames) { Cache cache = this.cacheManager.getCache(cacheName); - Assert.notNull(cache, "Cannot find cache named [" + cacheName + "] for " + operation); + Assert.notNull(cache, "Cannot find cache named '" + cacheName + "' for " + operation); caches.add(cache); } return caches; @@ -249,8 +248,7 @@ public abstract class CacheAspectSupport implements InitializingBean { } } - private void logInvalidating(CacheOperationContext context, - CacheEvictOperation operation, Object key) { + private void logInvalidating(CacheOperationContext context, CacheEvictOperation operation, Object key) { if (this.logger.isTraceEnabled()) { this.logger.trace("Invalidating " + (key == null ? "entire cache" : "cache key " + key) + " for operation " + operation + " on method " + context.method); @@ -326,8 +324,7 @@ public abstract class CacheAspectSupport implements InitializingBean { Method method, Object[] args, Object target, Class targetClass) { for (CacheOperation operation : operations) { - this.contexts.add(operation.getClass(), new CacheOperationContext(operation, - method, args, target, targetClass)); + this.contexts.add(operation.getClass(), new CacheOperationContext(operation, method, args, target, targetClass)); } }