Skip to content

Commit

Permalink
Adapt to deprecations in Spring Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Jul 27, 2022
1 parent aac3ccf commit fdb1ee5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private void addConfiguration(SimpleMetadataReaderFactory readerFactory,
}

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private boolean isAutoConfiguration(MetadataReader metadataReader) {

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ protected Class<?> getAnnotationClass() {
* @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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ private Collection<String> getConfigurationsForAnnotation(Class<?> source, Annot
}

protected Collection<String> loadFactoryNames(Class<?> source) {
@SuppressWarnings("deprecation")
List<String> factoryNames = new ArrayList<>(
SpringFactoriesLoader.loadFactoryNames(source, getBeanClassLoader()));
ImportCandidates.load(source, getBeanClassLoader()).forEach(factoryNames::add);
Expand Down

0 comments on commit fdb1ee5

Please sign in to comment.