Apply "instanceof pattern matching" Eclipse clean-up in spring-aop
This commit also applies additional clean-up tasks such as the following. - final fields This has only been applied to `src/main/java`.
This commit is contained in:
@@ -78,10 +78,9 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
*/
|
||||
public static JoinPoint currentJoinPoint() {
|
||||
MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
if (!(mi instanceof ProxyMethodInvocation pmi)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
}
|
||||
ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
|
||||
JoinPoint jp = (JoinPoint) pmi.getUserAttribute(JOIN_POINT_KEY);
|
||||
if (jp == null) {
|
||||
jp = new MethodInvocationProceedingJoinPoint(pmi);
|
||||
@@ -714,10 +713,9 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AdviceExcludingMethodMatcher)) {
|
||||
if (!(other instanceof AdviceExcludingMethodMatcher otherMm)) {
|
||||
return false;
|
||||
}
|
||||
AdviceExcludingMethodMatcher otherMm = (AdviceExcludingMethodMatcher) other;
|
||||
return this.adviceMethod.equals(otherMm.adviceMethod);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
|
||||
/** The pointcut expression associated with the advice, as a simple String. */
|
||||
@Nullable
|
||||
private String pointcutExpression;
|
||||
private final String pointcutExpression;
|
||||
|
||||
private boolean raiseExceptions;
|
||||
|
||||
@@ -759,10 +759,10 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
*/
|
||||
private static class PointcutBody {
|
||||
|
||||
private int numTokensConsumed;
|
||||
private final int numTokensConsumed;
|
||||
|
||||
@Nullable
|
||||
private String text;
|
||||
private final String text;
|
||||
|
||||
public PointcutBody(int tokens, @Nullable String text) {
|
||||
this.numTokensConsumed = tokens;
|
||||
|
||||
@@ -63,10 +63,9 @@ public class AspectJAroundAdvice extends AbstractAspectJAdvice implements Method
|
||||
@Override
|
||||
@Nullable
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
if (!(mi instanceof ProxyMethodInvocation pmi)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
}
|
||||
ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
|
||||
ProceedingJoinPoint pjp = lazyGetProceedingJoinPoint(pmi);
|
||||
JoinPointMatch jpm = getJoinPointMatch(pmi);
|
||||
return invokeAdviceMethod(pjp, jpm, null, null);
|
||||
|
||||
@@ -523,10 +523,9 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AspectJExpressionPointcut)) {
|
||||
if (!(other instanceof AspectJExpressionPointcut otherPc)) {
|
||||
return false;
|
||||
}
|
||||
AspectJExpressionPointcut otherPc = (AspectJExpressionPointcut) other;
|
||||
return ObjectUtils.nullSafeEquals(this.getExpression(), otherPc.getExpression()) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutDeclarationScope, otherPc.pointcutDeclarationScope) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutParameterNames, otherPc.pointcutParameterNames) &&
|
||||
|
||||
@@ -97,10 +97,9 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AspectJPointcutAdvisor)) {
|
||||
if (!(other instanceof AspectJPointcutAdvisor otherAdvisor)) {
|
||||
return false;
|
||||
}
|
||||
AspectJPointcutAdvisor otherAdvisor = (AspectJPointcutAdvisor) other;
|
||||
return this.advice.equals(otherAdvisor.advice);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,8 +214,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
||||
private String resolveExpression(A annotation) {
|
||||
for (String attributeName : EXPRESSION_ATTRIBUTES) {
|
||||
Object val = AnnotationUtils.getValue(annotation, attributeName);
|
||||
if (val instanceof String) {
|
||||
String str = (String) val;
|
||||
if (val instanceof String str) {
|
||||
if (!str.isEmpty()) {
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser {
|
||||
NodeList childNodes = element.getChildNodes();
|
||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
Node node = childNodes.item(i);
|
||||
if (node instanceof Element) {
|
||||
Element includeElement = (Element) node;
|
||||
if (node instanceof Element includeElement) {
|
||||
TypedStringValue valueHolder = new TypedStringValue(includeElement.getAttribute("name"));
|
||||
valueHolder.setSource(parserContext.extractSource(includeElement));
|
||||
includePatterns.add(valueHolder);
|
||||
|
||||
@@ -93,7 +93,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
||||
private static final int POINTCUT_INDEX = 1;
|
||||
private static final int ASPECT_INSTANCE_FACTORY_INDEX = 2;
|
||||
|
||||
private ParseState parseState = new ParseState();
|
||||
private final ParseState parseState = new ParseState();
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,8 +42,7 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
|
||||
@Override
|
||||
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
|
||||
boolean proxyTargetClass = true;
|
||||
if (node instanceof Element) {
|
||||
Element ele = (Element) node;
|
||||
if (node instanceof Element ele) {
|
||||
if (ele.hasAttribute(PROXY_TARGET_CLASS)) {
|
||||
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
|
||||
}
|
||||
|
||||
@@ -69,8 +69,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
||||
return bean;
|
||||
}
|
||||
|
||||
if (bean instanceof Advised) {
|
||||
Advised advised = (Advised) bean;
|
||||
if (bean instanceof Advised advised) {
|
||||
if (!advised.isFrozen() && isEligible(AopUtils.getTargetClass(bean))) {
|
||||
// Add our local Advisor to the existing proxy's Advisor chain...
|
||||
if (this.beforeExistingAdvisors) {
|
||||
|
||||
@@ -283,8 +283,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
}
|
||||
|
||||
Advisor advisor = this.advisors.remove(index);
|
||||
if (advisor instanceof IntroductionAdvisor) {
|
||||
IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
|
||||
if (advisor instanceof IntroductionAdvisor ia) {
|
||||
// We need to remove introduction interfaces.
|
||||
for (Class<?> ifc : ia.getInterfaces()) {
|
||||
removeInterface(ifc);
|
||||
|
||||
@@ -949,10 +949,9 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ProxyCallbackFilter)) {
|
||||
if (!(other instanceof ProxyCallbackFilter otherCallbackFilter)) {
|
||||
return false;
|
||||
}
|
||||
ProxyCallbackFilter otherCallbackFilter = (ProxyCallbackFilter) other;
|
||||
AdvisedSupport otherAdvised = otherCallbackFilter.advised;
|
||||
if (this.advised.isFrozen() != otherAdvised.isFrozen()) {
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -60,9 +60,8 @@ public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializ
|
||||
Boolean hasIntroductions = null;
|
||||
|
||||
for (Advisor advisor : advisors) {
|
||||
if (advisor instanceof PointcutAdvisor) {
|
||||
if (advisor instanceof PointcutAdvisor pointcutAdvisor) {
|
||||
// Add it conditionally.
|
||||
PointcutAdvisor pointcutAdvisor = (PointcutAdvisor) advisor;
|
||||
if (config.isPreFiltered() || pointcutAdvisor.getPointcut().getClassFilter().matches(actualClass)) {
|
||||
MethodMatcher mm = pointcutAdvisor.getPointcut().getMethodMatcher();
|
||||
boolean match;
|
||||
@@ -90,8 +89,7 @@ public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializ
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (advisor instanceof IntroductionAdvisor) {
|
||||
IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
|
||||
else if (advisor instanceof IntroductionAdvisor ia) {
|
||||
if (config.isPreFiltered() || ia.getClassFilter().matches(actualClass)) {
|
||||
Interceptor[] interceptors = registry.getInterceptors(advisor);
|
||||
interceptorList.addAll(Arrays.asList(interceptors));
|
||||
@@ -111,8 +109,7 @@ public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializ
|
||||
*/
|
||||
private static boolean hasMatchingIntroductions(Advisor[] advisors, Class<?> actualClass) {
|
||||
for (Advisor advisor : advisors) {
|
||||
if (advisor instanceof IntroductionAdvisor) {
|
||||
IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
|
||||
if (advisor instanceof IntroductionAdvisor ia) {
|
||||
if (ia.getClassFilter().matches(actualClass)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -479,8 +479,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
Advisor[] advisors = getAdvisors();
|
||||
List<Advisor> freshAdvisors = new ArrayList<>(advisors.length);
|
||||
for (Advisor advisor : advisors) {
|
||||
if (advisor instanceof PrototypePlaceholderAdvisor) {
|
||||
PrototypePlaceholderAdvisor pa = (PrototypePlaceholderAdvisor) advisor;
|
||||
if (advisor instanceof PrototypePlaceholderAdvisor pa) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Refreshing bean named '" + pa.getBeanName() + "'");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -165,11 +165,9 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
||||
|
||||
Object interceptorOrInterceptionAdvice =
|
||||
this.interceptorsAndDynamicMethodMatchers.get(++this.currentInterceptorIndex);
|
||||
if (interceptorOrInterceptionAdvice instanceof InterceptorAndDynamicMethodMatcher) {
|
||||
if (interceptorOrInterceptionAdvice instanceof InterceptorAndDynamicMethodMatcher dm) {
|
||||
// Evaluate dynamic method matcher here: static part will already have
|
||||
// been evaluated and found to match.
|
||||
InterceptorAndDynamicMethodMatcher dm =
|
||||
(InterceptorAndDynamicMethodMatcher) interceptorOrInterceptionAdvice;
|
||||
Class<?> targetClass = (this.targetClass != null ? this.targetClass : this.method.getDeclaringClass());
|
||||
if (dm.methodMatcher.matches(this.method, targetClass, this.arguments)) {
|
||||
return dm.interceptor.invoke(this);
|
||||
|
||||
@@ -58,10 +58,9 @@ public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Se
|
||||
if (adviceObject instanceof Advisor) {
|
||||
return (Advisor) adviceObject;
|
||||
}
|
||||
if (!(adviceObject instanceof Advice)) {
|
||||
if (!(adviceObject instanceof Advice advice)) {
|
||||
throw new UnknownAdviceTypeException(adviceObject);
|
||||
}
|
||||
Advice advice = (Advice) adviceObject;
|
||||
if (advice instanceof MethodInterceptor) {
|
||||
// So well-known it doesn't even need an adapter.
|
||||
return new DefaultPointcutAdvisor(advice);
|
||||
|
||||
@@ -68,10 +68,9 @@ public abstract class ExposeBeanNameAdvisors {
|
||||
* @throws IllegalStateException if the bean name has not been exposed
|
||||
*/
|
||||
public static String getBeanName(MethodInvocation mi) throws IllegalStateException {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
if (!(mi instanceof ProxyMethodInvocation pmi)) {
|
||||
throw new IllegalArgumentException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
}
|
||||
ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
|
||||
String beanName = (String) pmi.getUserAttribute(BEAN_NAME_ATTRIBUTE);
|
||||
if (beanName == null) {
|
||||
throw new IllegalStateException("Cannot get bean name; not set on MethodInvocation: " + mi);
|
||||
@@ -113,10 +112,9 @@ public abstract class ExposeBeanNameAdvisors {
|
||||
@Override
|
||||
@Nullable
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
if (!(mi instanceof ProxyMethodInvocation pmi)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
}
|
||||
ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
|
||||
pmi.setUserAttribute(BEAN_NAME_ATTRIBUTE, this.beanName);
|
||||
return mi.proceed();
|
||||
}
|
||||
@@ -138,10 +136,9 @@ public abstract class ExposeBeanNameAdvisors {
|
||||
@Override
|
||||
@Nullable
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
if (!(mi instanceof ProxyMethodInvocation pmi)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
}
|
||||
ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
|
||||
pmi.setUserAttribute(BEAN_NAME_ATTRIBUTE, this.beanName);
|
||||
return super.invoke(mi);
|
||||
}
|
||||
|
||||
@@ -85,11 +85,9 @@ public class ScopedProxyFactoryBean extends ProxyConfig
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (!(beanFactory instanceof ConfigurableBeanFactory)) {
|
||||
if (!(beanFactory instanceof ConfigurableBeanFactory cbf)) {
|
||||
throw new IllegalStateException("Not running in a ConfigurableBeanFactory: " + beanFactory);
|
||||
}
|
||||
ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) beanFactory;
|
||||
|
||||
this.scopedTargetSource.setBeanFactory(beanFactory);
|
||||
|
||||
ProxyFactory pf = new ProxyFactory();
|
||||
|
||||
@@ -69,10 +69,9 @@ public abstract class AbstractPointcutAdvisor implements PointcutAdvisor, Ordere
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PointcutAdvisor)) {
|
||||
if (!(other instanceof PointcutAdvisor otherAdvisor)) {
|
||||
return false;
|
||||
}
|
||||
PointcutAdvisor otherAdvisor = (PointcutAdvisor) other;
|
||||
return (ObjectUtils.nullSafeEquals(getAdvice(), otherAdvisor.getAdvice()) &&
|
||||
ObjectUtils.nullSafeEquals(getPointcut(), otherAdvisor.getPointcut()));
|
||||
}
|
||||
|
||||
@@ -200,10 +200,9 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AbstractRegexpMethodPointcut)) {
|
||||
if (!(other instanceof AbstractRegexpMethodPointcut otherPointcut)) {
|
||||
return false;
|
||||
}
|
||||
AbstractRegexpMethodPointcut otherPointcut = (AbstractRegexpMethodPointcut) other;
|
||||
return (Arrays.equals(this.patterns, otherPointcut.patterns) &&
|
||||
Arrays.equals(this.excludedPatterns, otherPointcut.excludedPatterns));
|
||||
}
|
||||
|
||||
@@ -284,8 +284,7 @@ public abstract class AopUtils {
|
||||
if (advisor instanceof IntroductionAdvisor) {
|
||||
return ((IntroductionAdvisor) advisor).getClassFilter().matches(targetClass);
|
||||
}
|
||||
else if (advisor instanceof PointcutAdvisor) {
|
||||
PointcutAdvisor pca = (PointcutAdvisor) advisor;
|
||||
else if (advisor instanceof PointcutAdvisor pca) {
|
||||
return canApply(pca.getPointcut(), targetClass, hasIntroductions);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -188,10 +188,9 @@ public class ComposablePointcut implements Pointcut, Serializable {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ComposablePointcut)) {
|
||||
if (!(other instanceof ComposablePointcut otherPointcut)) {
|
||||
return false;
|
||||
}
|
||||
ComposablePointcut otherPointcut = (ComposablePointcut) other;
|
||||
return (this.classFilter.equals(otherPointcut.classFilter) &&
|
||||
this.methodMatcher.equals(otherPointcut.methodMatcher));
|
||||
}
|
||||
|
||||
@@ -128,10 +128,9 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ControlFlowPointcut)) {
|
||||
if (!(other instanceof ControlFlowPointcut that)) {
|
||||
return false;
|
||||
}
|
||||
ControlFlowPointcut that = (ControlFlowPointcut) other;
|
||||
return (this.clazz.equals(that.clazz)) && ObjectUtils.nullSafeEquals(this.methodName, that.methodName);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,10 +155,9 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof DefaultIntroductionAdvisor)) {
|
||||
if (!(other instanceof DefaultIntroductionAdvisor otherAdvisor)) {
|
||||
return false;
|
||||
}
|
||||
DefaultIntroductionAdvisor otherAdvisor = (DefaultIntroductionAdvisor) other;
|
||||
return (this.advice.equals(otherAdvisor.advice) && this.interfaces.equals(otherAdvisor.interfaces));
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@ public class DelegatePerTargetObjectIntroductionInterceptor extends Introduction
|
||||
*/
|
||||
private final Map<Object, Object> delegateMap = new WeakHashMap<>();
|
||||
|
||||
private Class<?> defaultImplType;
|
||||
private final Class<?> defaultImplType;
|
||||
|
||||
private Class<?> interfaceType;
|
||||
private final Class<?> interfaceType;
|
||||
|
||||
|
||||
public DelegatePerTargetObjectIntroductionInterceptor(Class<?> defaultImplType, Class<?> interfaceType) {
|
||||
|
||||
@@ -146,10 +146,9 @@ public abstract class MethodMatchers {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof UnionMethodMatcher)) {
|
||||
if (!(other instanceof UnionMethodMatcher that)) {
|
||||
return false;
|
||||
}
|
||||
UnionMethodMatcher that = (UnionMethodMatcher) other;
|
||||
return (this.mm1.equals(that.mm1) && this.mm2.equals(that.mm2));
|
||||
}
|
||||
|
||||
@@ -223,8 +222,7 @@ public abstract class MethodMatchers {
|
||||
}
|
||||
ClassFilter otherCf1 = ClassFilter.TRUE;
|
||||
ClassFilter otherCf2 = ClassFilter.TRUE;
|
||||
if (other instanceof ClassFilterAwareUnionMethodMatcher) {
|
||||
ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher) other;
|
||||
if (other instanceof ClassFilterAwareUnionMethodMatcher cfa) {
|
||||
otherCf1 = cfa.cf1;
|
||||
otherCf2 = cfa.cf2;
|
||||
}
|
||||
@@ -312,10 +310,9 @@ public abstract class MethodMatchers {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof IntersectionMethodMatcher)) {
|
||||
if (!(other instanceof IntersectionMethodMatcher that)) {
|
||||
return false;
|
||||
}
|
||||
IntersectionMethodMatcher that = (IntersectionMethodMatcher) other;
|
||||
return (this.mm1.equals(that.mm1) && this.mm2.equals(that.mm2));
|
||||
}
|
||||
|
||||
|
||||
@@ -72,10 +72,9 @@ public class AnnotationClassFilter implements ClassFilter {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AnnotationClassFilter)) {
|
||||
if (!(other instanceof AnnotationClassFilter otherCf)) {
|
||||
return false;
|
||||
}
|
||||
AnnotationClassFilter otherCf = (AnnotationClassFilter) other;
|
||||
return (this.annotationType.equals(otherCf.annotationType) && this.checkInherited == otherCf.checkInherited);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,10 +125,9 @@ public class AnnotationMatchingPointcut implements Pointcut {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AnnotationMatchingPointcut)) {
|
||||
if (!(other instanceof AnnotationMatchingPointcut otherPointcut)) {
|
||||
return false;
|
||||
}
|
||||
AnnotationMatchingPointcut otherPointcut = (AnnotationMatchingPointcut) other;
|
||||
return (this.classFilter.equals(otherPointcut.classFilter) &&
|
||||
this.methodMatcher.equals(otherPointcut.methodMatcher));
|
||||
}
|
||||
@@ -189,10 +188,9 @@ public class AnnotationMatchingPointcut implements Pointcut {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof AnnotationCandidateClassFilter)) {
|
||||
if (!(obj instanceof AnnotationCandidateClassFilter that)) {
|
||||
return false;
|
||||
}
|
||||
AnnotationCandidateClassFilter that = (AnnotationCandidateClassFilter) obj;
|
||||
return this.annotationType.equals(that.annotationType);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,10 +92,9 @@ public class AnnotationMethodMatcher extends StaticMethodMatcher {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AnnotationMethodMatcher)) {
|
||||
if (!(other instanceof AnnotationMethodMatcher otherMm)) {
|
||||
return false;
|
||||
}
|
||||
AnnotationMethodMatcher otherMm = (AnnotationMethodMatcher) other;
|
||||
return (this.annotationType.equals(otherMm.annotationType) && this.checkInherited == otherMm.checkInherited);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,10 +135,9 @@ public final class EmptyTargetSource implements TargetSource, Serializable {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof EmptyTargetSource)) {
|
||||
if (!(other instanceof EmptyTargetSource otherTs)) {
|
||||
return false;
|
||||
}
|
||||
EmptyTargetSource otherTs = (EmptyTargetSource) other;
|
||||
return (ObjectUtils.nullSafeEquals(this.targetClass, otherTs.targetClass) && this.isStatic == otherTs.isStatic);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,10 +85,9 @@ public class SingletonTargetSource implements TargetSource, Serializable {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SingletonTargetSource)) {
|
||||
if (!(other instanceof SingletonTargetSource otherTargetSource)) {
|
||||
return false;
|
||||
}
|
||||
SingletonTargetSource otherTargetSource = (SingletonTargetSource) other;
|
||||
return this.target.equals(otherTargetSource.target);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user