|
|
|
@ -17,7 +17,6 @@ |
|
|
|
package org.springframework.aop.aspectj.annotation; |
|
|
|
package org.springframework.aop.aspectj.annotation; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
|
import java.io.Serializable; |
|
|
|
import java.lang.annotation.Annotation; |
|
|
|
|
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
@ -48,7 +47,6 @@ import org.springframework.aop.framework.AopConfigException; |
|
|
|
import org.springframework.aop.support.DefaultPointcutAdvisor; |
|
|
|
import org.springframework.aop.support.DefaultPointcutAdvisor; |
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
import org.springframework.core.annotation.AnnotationUtils; |
|
|
|
import org.springframework.core.annotation.AnnotationUtils; |
|
|
|
import org.springframework.core.convert.converter.Converter; |
|
|
|
|
|
|
|
import org.springframework.core.convert.converter.ConvertingComparator; |
|
|
|
import org.springframework.core.convert.converter.ConvertingComparator; |
|
|
|
import org.springframework.util.ClassUtils; |
|
|
|
import org.springframework.util.ClassUtils; |
|
|
|
import org.springframework.util.ReflectionUtils; |
|
|
|
import org.springframework.util.ReflectionUtils; |
|
|
|
@ -84,10 +82,11 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto |
|
|
|
// @AfterThrowing methods due to the fact that AspectJAfterAdvice.invoke(MethodInvocation)
|
|
|
|
// @AfterThrowing methods due to the fact that AspectJAfterAdvice.invoke(MethodInvocation)
|
|
|
|
// invokes proceed() in a `try` block and only invokes the @After advice method
|
|
|
|
// invokes proceed() in a `try` block and only invokes the @After advice method
|
|
|
|
// in a corresponding `finally` block.
|
|
|
|
// in a corresponding `finally` block.
|
|
|
|
|
|
|
|
@SuppressWarnings("NullAway") |
|
|
|
Comparator<Method> adviceKindComparator = new ConvertingComparator<>( |
|
|
|
Comparator<Method> adviceKindComparator = new ConvertingComparator<>( |
|
|
|
new InstanceComparator<>( |
|
|
|
new InstanceComparator<>( |
|
|
|
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class), |
|
|
|
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class), |
|
|
|
(Converter<Method, Annotation>) method -> { |
|
|
|
method -> { |
|
|
|
AspectJAnnotation ann = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method); |
|
|
|
AspectJAnnotation ann = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method); |
|
|
|
return (ann != null ? ann.getAnnotation() : null); |
|
|
|
return (ann != null ? ann.getAnnotation() : null); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|