diff --git a/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj b/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj index 923324ceb3947d7393135ace4e2f27b6ebd8ac33..2bbf992de15734472122fd2599542e3a5e0ed3fb 100644 --- a/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj +++ b/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2002-2011 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. @@ -36,8 +36,9 @@ import org.springframework.cache.interceptor.CacheOperationSource; *

NB: If a method implements an interface that is itself * cache annotated, the relevant Spring cache definition * will not be resolved. - + * * @author Costin Leau + * @since 3.1 */ public abstract aspect AbstractCacheAspect extends CacheAspectSupport { @@ -50,7 +51,7 @@ public abstract aspect AbstractCacheAspect extends CacheAspectSupport { * cache metadata for each joinpoint. */ protected AbstractCacheAspect(CacheOperationSource... cos) { - setCacheDefinitionSources(cos); + setCacheOperationSources(cos); } @SuppressAjWarnings("adviceDidNotMatch") @@ -59,7 +60,6 @@ public abstract aspect AbstractCacheAspect extends CacheAspectSupport { Method method = methodSignature.getMethod(); Callable ajInvocation = new Callable() { - public Object call() { return proceed(cachedObject); } @@ -67,7 +67,8 @@ public abstract aspect AbstractCacheAspect extends CacheAspectSupport { try { return execute(ajInvocation, thisJoinPoint.getTarget(), method, thisJoinPoint.getArgs()); - } catch (Exception ex) { + } + catch (Exception ex) { throw new UnsupportedOperationException("Should not throw exception", ex); } } @@ -78,4 +79,5 @@ public abstract aspect AbstractCacheAspect extends CacheAspectSupport { * will be retrieved using Spring's {@link CacheOperationSource} interface. */ protected abstract pointcut cacheMethodExecution(Object cachedObject); -} \ No newline at end of file + +} diff --git a/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj b/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj index 4cb3fe1192c7d70636201a6e09cfd99fdf8fa6bf..87614cf8c3ce245eac13c2707bbb4168f112319d 100644 --- a/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj +++ b/org.springframework.aspects/src/main/java/org/springframework/cache/aspectj/AnnotationCacheAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2002-2011 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. @@ -21,9 +21,8 @@ import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; /** - * Concrete AspectJ cache aspect using Spring {@link Cacheable} annotation - * for JDK 1.5+. - * + * Concrete AspectJ cache aspect using Spring's {@link Cacheable} annotation. + * *

When using this aspect, you must annotate the implementation class * (and/or methods within that class), not the interface (if any) that * the class implements. AspectJ follows Java's rule that annotations on @@ -37,8 +36,9 @@ import org.springframework.cache.annotation.Cacheable; * Any method may be annotated (regardless of visibility). * Annotating non-public methods directly is the only way * to get caching demarcation for the execution of such operations. - * + * * @author Costin Leau + * @since 3.1 */ public aspect AnnotationCacheAspect extends AbstractCacheAspect { @@ -83,4 +83,5 @@ public aspect AnnotationCacheAspect extends AbstractCacheAspect { (executionOfAnyPublicMethodInAtCacheableType() || executionOfAnyPublicMethodInAtCacheEvictType() || executionOfCacheableMethod() || executionOfCacheEvictMethod()) && this(cachedObject); -} \ No newline at end of file + +} diff --git a/org.springframework.aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml b/org.springframework.aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml index da2514ccd53340e08b0c185d5eed81ff64fac6ee..e962a2a654e5f5e6ac982384cf36177726631f0b 100644 --- a/org.springframework.aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml +++ b/org.springframework.aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml @@ -13,7 +13,7 @@ - +