From 1aa0ea02818e68a52d52050f4bd44ff30530229c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 25 Sep 2019 13:51:20 +0200 Subject: [PATCH] Fix nullability declarations on internal ParserStrategyUtils methods --- .../context/annotation/ParserStrategyUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ParserStrategyUtils.java b/spring-context/src/main/java/org/springframework/context/annotation/ParserStrategyUtils.java index 94f64af36c1..4ecae70e6aa 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ParserStrategyUtils.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ParserStrategyUtils.java @@ -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"); * you may not use this file except in compliance with the License. @@ -99,6 +99,7 @@ abstract class ParserStrategyUtils { return parameters; } + @Nullable private static Object resolveParameter(Class parameterType, Environment environment, ResourceLoader resourceLoader, BeanDefinitionRegistry registry, @Nullable ClassLoader classLoader) { @@ -110,17 +111,16 @@ abstract class ParserStrategyUtils { return resourceLoader; } if (parameterType == BeanFactory.class) { - return (registry instanceof BeanFactory) ? registry : null; + return (registry instanceof BeanFactory ? registry : null); } if (parameterType == ClassLoader.class) { return classLoader; } - throw new IllegalStateException( - "Illegal method parameter type " + parameterType.getName()); + throw new IllegalStateException("Illegal method parameter type: " + parameterType.getName()); } 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 BeanClassLoaderAware && classLoader != null) {