Fix nullability declarations on internal ParserStrategyUtils methods

This commit is contained in:
Juergen Hoeller 2019-09-25 13:51:20 +02:00
parent 853d4c38ae
commit 1aa0ea0281
1 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -99,6 +99,7 @@ abstract class ParserStrategyUtils {
return parameters; return parameters;
} }
@Nullable
private static Object resolveParameter(Class<?> parameterType, private static Object resolveParameter(Class<?> parameterType,
Environment environment, ResourceLoader resourceLoader, Environment environment, ResourceLoader resourceLoader,
BeanDefinitionRegistry registry, @Nullable ClassLoader classLoader) { BeanDefinitionRegistry registry, @Nullable ClassLoader classLoader) {
@ -110,17 +111,16 @@ abstract class ParserStrategyUtils {
return resourceLoader; return resourceLoader;
} }
if (parameterType == BeanFactory.class) { if (parameterType == BeanFactory.class) {
return (registry instanceof BeanFactory) ? registry : null; return (registry instanceof BeanFactory ? registry : null);
} }
if (parameterType == ClassLoader.class) { if (parameterType == ClassLoader.class) {
return classLoader; return classLoader;
} }
throw new IllegalStateException( throw new IllegalStateException("Illegal method parameter type: " + parameterType.getName());
"Illegal method parameter type " + parameterType.getName());
} }
private static void invokeAwareMethods(Object parserStrategyBean, Environment environment, private static void invokeAwareMethods(Object parserStrategyBean, Environment environment,
ResourceLoader resourceLoader, BeanDefinitionRegistry registry, ClassLoader classLoader) { ResourceLoader resourceLoader, BeanDefinitionRegistry registry, @Nullable ClassLoader classLoader) {
if (parserStrategyBean instanceof Aware) { if (parserStrategyBean instanceof Aware) {
if (parserStrategyBean instanceof BeanClassLoaderAware && classLoader != null) { if (parserStrategyBean instanceof BeanClassLoaderAware && classLoader != null) {