Skip to content

Commit f7496a3

Browse files
committed
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
1 parent 0f92ba1 commit f7496a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ private boolean isAspectMaterialized() {
303303
@Override
304304
public boolean equals(@Nullable Object other) {
305305
return (this == other || (other instanceof PerTargetInstantiationModelPointcut that &&
306-
ObjectUtils.nullSafeEquals(this.declaredPointcut.getExpression(), that.declaredPointcut.getExpression())));
306+
ObjectUtils.nullSafeEquals(this.declaredPointcut, that.declaredPointcut) &&
307+
ObjectUtils.nullSafeEquals(this.preInstantiationPointcut, that.preInstantiationPointcut) &&
308+
ObjectUtils.nullSafeEquals(this.aspectInstanceFactory, that.aspectInstanceFactory)));
307309
}
308310

309311
@Override

0 commit comments

Comments
 (0)