Revert "Allow to use @Named annotation without having to set the bean as @Primary"
This reverts commit ca0be6e192.
This commit is contained in:
@@ -110,14 +110,8 @@ public class SpringModule implements Module {
|
||||
@Override
|
||||
public Object get() {
|
||||
if (this.result == null) {
|
||||
|
||||
String[] named = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, this.type);
|
||||
List<String> names = new ArrayList<>(named.length);
|
||||
for (String name : named) {
|
||||
if (name.equals(this.name)) names.add(name);
|
||||
}
|
||||
|
||||
if (names.size() == 1) {
|
||||
String[] names = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, this.type);
|
||||
if (names.length == 1) {
|
||||
this.result = this.beanFactory.getBean(this.name, this.type);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user