Browse Source

Expand scope of equals() in PerTargetInstantiationModelPointcut

This commit expands the scope of equality checks in the implementation
of equals() for PerTargetInstantiationModelPointcut to include all
fields instead of just the pointcut expression for the declared
pointcut.

See gh-31238
pull/31496/head
Sam Brannen 2 years ago
parent
commit
f7496a393d
  1. 4
      spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java

4
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java

@ -303,7 +303,9 @@ final class InstantiationModelAwarePointcutAdvisorImpl
@Override @Override
public boolean equals(@Nullable Object other) { public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof PerTargetInstantiationModelPointcut that && return (this == other || (other instanceof PerTargetInstantiationModelPointcut that &&
ObjectUtils.nullSafeEquals(this.declaredPointcut.getExpression(), that.declaredPointcut.getExpression()))); ObjectUtils.nullSafeEquals(this.declaredPointcut, that.declaredPointcut) &&
ObjectUtils.nullSafeEquals(this.preInstantiationPointcut, that.preInstantiationPointcut) &&
ObjectUtils.nullSafeEquals(this.aspectInstanceFactory, that.aspectInstanceFactory)));
} }
@Override @Override

Loading…
Cancel
Save