From 20b2941e301f8ae014b54180a27dc988488f9cd4 Mon Sep 17 00:00:00 2001 From: byteblogs168 <598092184@qq.com> Date: Sat, 9 Sep 2023 10:47:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:2.3.0=201.=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intercepter/EasyRetryPointcutAdvisor.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/intercepter/EasyRetryPointcutAdvisor.java b/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/intercepter/EasyRetryPointcutAdvisor.java index 2cbbb704..6517e4c1 100644 --- a/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/intercepter/EasyRetryPointcutAdvisor.java +++ b/easy-retry-client-core/src/main/java/com/aizuda/easy/retry/client/core/intercepter/EasyRetryPointcutAdvisor.java @@ -46,9 +46,6 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements } } - /** - * Set the {@code BeanFactory} to be used when looking up executors by qualifier. - */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; @@ -78,7 +75,7 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements } protected Pointcut buildPointcut() { - return new AnnotationClassOrMethodPointcut(Retryable.class); + return new EasyRetryAnnotationMethodPointcut(Retryable.class); } @Override @@ -86,13 +83,13 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements return pointcut; } - private final class AnnotationClassOrMethodPointcut extends StaticMethodMatcherPointcut { + private static final class EasyRetryAnnotationMethodPointcut extends StaticMethodMatcherPointcut { private final MethodMatcher methodResolver; - AnnotationClassOrMethodPointcut(Class annotationType) { + EasyRetryAnnotationMethodPointcut(Class annotationType) { this.methodResolver = new AnnotationMethodMatcher(annotationType, true); - setClassFilter(new AnnotationClassOrMethodFilter(annotationType)); + setClassFilter(new EasyRetryAnnotationClassOrMethodFilter(annotationType)); } @Override @@ -105,21 +102,20 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements if (this == other) { return true; } - if (!(other instanceof AnnotationClassOrMethodPointcut)) { + if (!(other instanceof EasyRetryAnnotationMethodPointcut)) { return false; } - AnnotationClassOrMethodPointcut otherAdvisor = (AnnotationClassOrMethodPointcut) other; + EasyRetryAnnotationMethodPointcut otherAdvisor = (EasyRetryAnnotationMethodPointcut) other; return ObjectUtils.nullSafeEquals(this.methodResolver, otherAdvisor.methodResolver); } } - - private static final class AnnotationClassOrMethodFilter extends AnnotationClassFilter { + private static final class EasyRetryAnnotationClassOrMethodFilter extends AnnotationClassFilter { private final AnnotationMethodsResolver methodResolver; - AnnotationClassOrMethodFilter(Class annotationType) { + EasyRetryAnnotationClassOrMethodFilter(Class annotationType) { super(annotationType, true); this.methodResolver = new AnnotationMethodsResolver(annotationType); } @@ -133,7 +129,7 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements private static class AnnotationMethodsResolver { - private Class annotationType; + private final Class annotationType; public AnnotationMethodsResolver(Class annotationType) { this.annotationType = annotationType; @@ -155,6 +151,4 @@ public class EasyRetryPointcutAdvisor extends AbstractPointcutAdvisor implements } - - }