Skip to content

Commit 4fa33df

Browse files
committed
Refine null-safety in the spring-aop module
See gh-34154
1 parent 9516d9b commit 4fa33df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -570,22 +570,22 @@ else if (this.joinPointStaticPartArgumentIndex != -1) {
570570
for (PointcutParameter parameter : parameterBindings) {
571571
String name = parameter.getName();
572572
Integer index = this.argumentBindings.get(name);
573-
Assert.notNull(index, "Index must not be null");
573+
Assert.state(index != null, "Index must not be null");
574574
adviceInvocationArgs[index] = parameter.getBinding();
575575
numBound++;
576576
}
577577
}
578578
// binding from returning clause
579579
if (this.returningName != null) {
580580
Integer index = this.argumentBindings.get(this.returningName);
581-
Assert.notNull(index, "Index must not be null");
581+
Assert.state(index != null, "Index must not be null");
582582
adviceInvocationArgs[index] = returnValue;
583583
numBound++;
584584
}
585585
// binding from thrown exception
586586
if (this.throwingName != null) {
587587
Integer index = this.argumentBindings.get(this.throwingName);
588-
Assert.notNull(index, "Index must not be null");
588+
Assert.state(index != null, "Index must not be null");
589589
adviceInvocationArgs[index] = ex;
590590
numBound++;
591591
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public List<Advisor> buildAspectJAdvisors() {
157157
}
158158
else {
159159
MetadataAwareAspectInstanceFactory factory = this.aspectFactoryCache.get(aspectName);
160-
Assert.notNull(factory, "Factory must not be null");
160+
Assert.state(factory != null, "Factory must not be null");
161161
advisors.addAll(this.advisorFactory.getAdvisors(factory));
162162
}
163163
}

0 commit comments

Comments
 (0)