Skip to content

Add javadoc notes on potential exception suppression in ListableBeanFactory#getBeansOfType #34629

Closed
@bekoenig

Description

@bekoenig

Hi,

DefaultListableBeanFactory#getBeansOfType catches and swallows BeanCreationException. The method documentation and name creates the assumption, that getBeansOfType has the same behiour like

for (String beanName : listableBeanFactory.getBeanNamesForType(type)) {
  Object bean = listableBeanFactory.getBean(beanName);
}

But the result is totally differnt. This behaviour is not well documented and unexpected to the client.

Best greetings,
Ben

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions