Restore restrictive getTypeForFactoryBeanFromAttributes check
See gh-29799 See gh-30987
This commit is contained in:
parent
f7c3e6480a
commit
a6ff95a69c
|
|
@ -73,13 +73,17 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
|
|||
*/
|
||||
ResolvableType getTypeForFactoryBeanFromAttributes(AttributeAccessor attributes) {
|
||||
Object attribute = attributes.getAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE);
|
||||
if (attribute == null) {
|
||||
return ResolvableType.NONE;
|
||||
}
|
||||
if (attribute instanceof ResolvableType resolvableType) {
|
||||
return resolvableType;
|
||||
}
|
||||
if (attribute instanceof Class<?> clazz) {
|
||||
return ResolvableType.forClass(clazz);
|
||||
}
|
||||
return ResolvableType.NONE;
|
||||
throw new IllegalArgumentException("Invalid value type for attribute '" +
|
||||
FactoryBean.OBJECT_TYPE_ATTRIBUTE + "': " + attribute.getClass().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue