Resulting Advisors will need to be evaluated for targets. * @param introductionField the field to introspect - * @return {@code null} if not an Advisor + * @return the Advisor instance, or {@code null} if not an Advisor */ private Advisor getDeclareParentsAdvisor(Field introductionField) { DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class); @@ -253,6 +253,15 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto AbstractAspectJAdvice springAdvice; switch (aspectJAnnotation.getAnnotationType()) { + case AtPointcut: + if (logger.isDebugEnabled()) { + logger.debug("Processing pointcut '" + candidateAdviceMethod.getName() + "'"); + } + return null; + case AtAround: + springAdvice = new AspectJAroundAdvice( + candidateAdviceMethod, expressionPointcut, aspectInstanceFactory); + break; case AtBefore: springAdvice = new AspectJMethodBeforeAdvice( candidateAdviceMethod, expressionPointcut, aspectInstanceFactory); @@ -277,15 +286,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto springAdvice.setThrowingName(afterThrowingAnnotation.throwing()); } break; - case AtAround: - springAdvice = new AspectJAroundAdvice( - candidateAdviceMethod, expressionPointcut, aspectInstanceFactory); - break; - case AtPointcut: - if (logger.isDebugEnabled()) { - logger.debug("Processing pointcut '" + candidateAdviceMethod.getName() + "'"); - } - return null; default: throw new UnsupportedOperationException( "Unsupported advice type on method: " + candidateAdviceMethod); @@ -299,6 +299,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto springAdvice.setArgumentNamesFromStringArray(argNames); } springAdvice.calculateArgumentBindings(); + return springAdvice; }