Adapt to deprecations in Spring Framework

See https://github.com/spring-projects/spring-framework/issues/27954
See gh-29699
pull/31903/head
Stephane Nicoll 2 years ago
parent aac3ccf59c
commit fdb1ee5f97

@ -90,6 +90,7 @@ class ManagementContextConfigurationImportSelector implements DeferredImportSele
}
protected List<String> loadFactoryNames() {
@SuppressWarnings("deprecation")
List<String> factoryNames = new ArrayList<>(
SpringFactoriesLoader.loadFactoryNames(ManagementContextConfiguration.class, this.classLoader));
ImportCandidates.load(ManagementContextConfiguration.class, this.classLoader).forEach(factoryNames::add);

@ -64,6 +64,7 @@ public class AutoConfigurationExcludeFilter implements TypeFilter, BeanClassLoad
protected List<String> getAutoConfigurations() {
if (this.autoConfigurations == null) {
@SuppressWarnings("deprecation")
List<String> autoConfigurations = new ArrayList<>(
SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class, this.beanClassLoader));
ImportCandidates.load(AutoConfiguration.class, this.beanClassLoader).forEach(autoConfigurations::add);

@ -179,6 +179,7 @@ public class AutoConfigurationImportSelector implements DeferredImportSelector,
* @return a list of candidate configurations
*/
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {
@SuppressWarnings("deprecation")
List<String> configurations = new ArrayList<>(
SpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader()));
ImportCandidates.load(AutoConfiguration.class, getBeanClassLoader()).forEach(configurations::add);

@ -96,6 +96,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
}
protected Collection<String> loadFactoryNames(Class<?> source) {
@SuppressWarnings("deprecation")
List<String> factoryNames = new ArrayList<>(
SpringFactoriesLoader.loadFactoryNames(source, getBeanClassLoader()));
ImportCandidates.load(source, getBeanClassLoader()).forEach(factoryNames::add);

Loading…
Cancel
Save