Merge branch '6.0.x'

# Conflicts:
#	spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java
This commit is contained in:
Juergen Hoeller
2023-07-19 00:37:06 +02:00
97 changed files with 405 additions and 822 deletions

View File

@@ -714,13 +714,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof AdviceExcludingMethodMatcher otherMm)) {
return false;
}
return this.adviceMethod.equals(otherMm.adviceMethod);
return (this == other || (other instanceof AdviceExcludingMethodMatcher that &&
this.adviceMethod.equals(that.adviceMethod)));
}
@Override

View File

@@ -516,21 +516,16 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof AspectJExpressionPointcut otherPc)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.getExpression(), otherPc.getExpression()) &&
ObjectUtils.nullSafeEquals(this.pointcutDeclarationScope, otherPc.pointcutDeclarationScope) &&
ObjectUtils.nullSafeEquals(this.pointcutParameterNames, otherPc.pointcutParameterNames) &&
ObjectUtils.nullSafeEquals(this.pointcutParameterTypes, otherPc.pointcutParameterTypes);
return (this == other || (other instanceof AspectJExpressionPointcut that &&
ObjectUtils.nullSafeEquals(getExpression(), that.getExpression()) &&
ObjectUtils.nullSafeEquals(this.pointcutDeclarationScope, that.pointcutDeclarationScope) &&
ObjectUtils.nullSafeEquals(this.pointcutParameterNames, that.pointcutParameterNames) &&
ObjectUtils.nullSafeEquals(this.pointcutParameterTypes, that.pointcutParameterTypes)));
}
@Override
public int hashCode() {
int hashCode = ObjectUtils.nullSafeHashCode(this.getExpression());
int hashCode = ObjectUtils.nullSafeHashCode(getExpression());
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutDeclarationScope);
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterNames);
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterTypes);

View File

@@ -89,13 +89,8 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof AspectJPointcutAdvisor otherAdvisor)) {
return false;
}
return this.advice.equals(otherAdvisor.advice);
return (this == other || (other instanceof AspectJPointcutAdvisor that &&
this.advice.equals(that.advice)));
}
@Override

View File

@@ -597,15 +597,10 @@ class CglibAopProxy implements AopProxy, Serializable {
}
if (other instanceof Factory factory) {
Callback callback = factory.getCallback(INVOKE_EQUALS);
if (!(callback instanceof EqualsInterceptor equalsInterceptor)) {
return false;
}
AdvisedSupport otherAdvised = equalsInterceptor.advised;
return AopProxyUtils.equalsInProxy(this.advised, otherAdvised);
}
else {
return false;
return (callback instanceof EqualsInterceptor that &&
AopProxyUtils.equalsInProxy(this.advised, that.advised));
}
return false;
}
}
@@ -920,20 +915,14 @@ class CglibAopProxy implements AopProxy, Serializable {
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof ProxyCallbackFilter otherCallbackFilter)) {
return false;
}
AdvisedSupport otherAdvised = otherCallbackFilter.advised;
return (this.advised.getAdvisorKey().equals(otherAdvised.getAdvisorKey()) &&
AopProxyUtils.equalsProxiedInterfaces(this.advised, otherAdvised) &&
ObjectUtils.nullSafeEquals(this.advised.getTargetClass(), otherAdvised.getTargetClass()) &&
this.advised.getTargetSource().isStatic() == otherAdvised.getTargetSource().isStatic() &&
this.advised.isFrozen() == otherAdvised.isFrozen() &&
this.advised.isExposeProxy() == otherAdvised.isExposeProxy() &&
this.advised.isOpaque() == otherAdvised.isOpaque());
return (this == other || (other instanceof ProxyCallbackFilter that &&
this.advised.getAdvisorKey().equals(that.advised.getAdvisorKey()) &&
AopProxyUtils.equalsProxiedInterfaces(this.advised, that.advised) &&
ObjectUtils.nullSafeEquals(this.advised.getTargetClass(), that.advised.getTargetClass()) &&
this.advised.getTargetSource().isStatic() == that.advised.getTargetSource().isStatic() &&
this.advised.isFrozen() == that.advised.isFrozen() &&
this.advised.isExposeProxy() == that.advised.isExposeProxy() &&
this.advised.isOpaque() == that.advised.isOpaque()));
}
@Override

View File

@@ -133,13 +133,9 @@ public final class EmptyTargetSource implements TargetSource, Serializable {
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof EmptyTargetSource otherTs)) {
return false;
}
return (ObjectUtils.nullSafeEquals(this.targetClass, otherTs.targetClass) && this.isStatic == otherTs.isStatic);
return (this == other || (other instanceof EmptyTargetSource that &&
ObjectUtils.nullSafeEquals(this.targetClass, that.targetClass) &&
this.isStatic == that.isStatic));
}
@Override