Improve @Autowired method injection on mixed nullability args
See gh-17215
This commit is contained in:
@@ -865,7 +865,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
|
||||
descriptors[i] = currDesc;
|
||||
try {
|
||||
Object arg = beanFactory.resolveDependency(currDesc, beanName, autowiredBeanNames, typeConverter);
|
||||
if (arg == null && !this.required) {
|
||||
if (arg == null && !this.required && !methodParam.isOptional()) {
|
||||
arguments = null;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user