From a347e4d3c2bdea343f8e7cb7eef399e77ed52cea Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 6 Dec 2011 20:48:49 +0000 Subject: [PATCH] optimized AnnotationTransactionAspect pointcut to avoid runtime checks (SPR-8890) --- .../transaction/aspectj/AnnotationTransactionAspect.aj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/org.springframework.aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj b/org.springframework.aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj index d6f887b259a..ff131fe705c 100644 --- a/org.springframework.aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj +++ b/org.springframework.aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj @@ -27,10 +27,10 @@ import org.springframework.transaction.annotation.Transactional; * the class implements. AspectJ follows Java's rule that annotations on * interfaces are not inherited. * - *

A @Transactional annotation on a class specifies the default transaction + *

An @Transactional annotation on a class specifies the default transaction * semantics for the execution of any public operation in the class. * - *

A @Transactional annotation on a method within the class overrides the + *

An @Transactional annotation on a method within the class overrides the * default transaction semantics given by the class annotation (if present). * Any method may be annotated (regardless of visibility). * Annotating non-public methods directly is the only way @@ -54,14 +54,14 @@ public aspect AnnotationTransactionAspect extends AbstractTransactionAspect { * Transactional annotation. */ private pointcut executionOfAnyPublicMethodInAtTransactionalType() : - execution(public * ((@Transactional *)+).*(..)) && @this(Transactional); + execution(* *(..)) && within(@Transactional *); /** * Matches the execution of any method with the * Transactional annotation. */ private pointcut executionOfTransactionalMethod() : - execution(* *(..)) && @annotation(Transactional); + execution(@Transactional * *(..)); /** * Definition of pointcut from super aspect - matched join points