diff --git a/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java b/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java index aea829b923..550f3c770f 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java @@ -268,7 +268,9 @@ public class SpringFactoriesLoader { * {@code null} to use the default * @throws IllegalArgumentException if an error occurs while loading factory names * @see #loadFactories + * @deprecated as of 6.0 in favor of {@link #load(Class, ArgumentResolver, FailureHandler)} */ + @Deprecated public static List loadFactoryNames(Class factoryType, @Nullable ClassLoader classLoader) { return forDefaultResourceLocation(classLoader).loadFactoryNames(factoryType); } diff --git a/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java b/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java index b9bf4c451b..5cde6c22c0 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java @@ -69,6 +69,7 @@ class SpringFactoriesLoaderTests { @Test + @Deprecated void loadFactoryNames() { List factoryNames = SpringFactoriesLoader.loadFactoryNames(DummyFactory.class, null); assertThat(factoryNames).containsExactlyInAnyOrder(MyDummyFactory1.class.getName(), MyDummyFactory2.class.getName());