Add missing precondition check to AutowireUtils.resolveDependency

See gh-2060
This commit is contained in:
Sam Brannen
2019-03-02 14:39:43 +01:00
parent 02be21d0dc
commit d4f544d42f
2 changed files with 17 additions and 7 deletions

View File

@@ -334,7 +334,7 @@ public abstract class AutowireUtils {
* that declares the parameter
* @param containingClass the concrete class that contains the parameter; this may
* differ from the class that declares the parameter in that it may be a subclass
* thereof, potentially substituting type variables
* thereof, potentially substituting type variables (must not be {@code null})
* @param beanFactory the {@code AutowireCapableBeanFactory} from which to resolve
* the dependency (must not be {@code null})
* @return the resolved object, or {@code null} if none found
@@ -351,6 +351,7 @@ public abstract class AutowireUtils {
throws BeansException {
Assert.notNull(parameter, "Parameter must not be null");
Assert.notNull(containingClass, "Containing class must not be null");
Assert.notNull(beanFactory, "AutowireCapableBeanFactory must not be null");
AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex);