Deprecate SpringFactoriesLoader#loadFactoryNames

Closes gh-27954
This commit is contained in:
Stephane Nicoll
2022-07-27 17:56:33 +02:00
parent 88e29689b6
commit 498668fc57
2 changed files with 3 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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());