Add missing variants of getBeanNamesForType

Update `ListableBeanFactory` and `BeanFactoryUtils` to add the missing
`getBeanNamesForType` methods that accept a `ResolvableType` rather
than a `Class`.

This completes the work started in 778a01943b.

Closes gh-23335
This commit is contained in:
Phillip Webb
2019-07-20 17:03:31 +01:00
committed by Juergen Hoeller
parent 30132b42c6
commit 2ee1ce61c0
7 changed files with 113 additions and 17 deletions

View File

@@ -1208,6 +1208,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
return getBeanFactory().getBeanNamesForType(type);
}
@Override
public String[] getBeanNamesForType(ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit) {
assertBeanFactoryActive();
return getBeanFactory().getBeanNamesForType(type, includeNonSingletons, allowEagerInit);
}
@Override
public String[] getBeanNamesForType(@Nullable Class<?> type) {
assertBeanFactoryActive();