Browse Source

Deprecate SpringFactoriesLoader#loadFactoryNames

Closes gh-27954
pull/30304/head
Stephane Nicoll 2 years ago
parent
commit
498668fc57
  1. 2
      spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
  2. 1
      spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java

2
spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java

@ -268,7 +268,9 @@ public class SpringFactoriesLoader { @@ -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<String> loadFactoryNames(Class<?> factoryType, @Nullable ClassLoader classLoader) {
return forDefaultResourceLocation(classLoader).loadFactoryNames(factoryType);
}

1
spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java

@ -69,6 +69,7 @@ class SpringFactoriesLoaderTests { @@ -69,6 +69,7 @@ class SpringFactoriesLoaderTests {
@Test
@Deprecated
void loadFactoryNames() {
List<String> factoryNames = SpringFactoriesLoader.loadFactoryNames(DummyFactory.class, null);
assertThat(factoryNames).containsExactlyInAnyOrder(MyDummyFactory1.class.getName(), MyDummyFactory2.class.getName());

Loading…
Cancel
Save