Skip to content

Commit

Permalink
Restore restrictive getTypeForFactoryBeanFromAttributes check
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Aug 3, 2023
1 parent f7c3e64 commit a6ff95a
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -73,13 +73,17 @@ protected Class<?> getTypeForFactoryBean(FactoryBean<?> factoryBean) {
*/
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());
}

/**
Expand Down

0 comments on commit a6ff95a

Please sign in to comment.