Skip to content

AbstractApplicationEventMulticaster returns multiple instances of same listener for getApplicationListeners() [SPR-7204] #11863

@spring-projects-issues

Description

@spring-projects-issues

Casey Hadden opened SPR-7204 and commented

AbstractApplicationEventMulticaster has two getApplicationListeners methods. The no parameter method will return duplicate listeners in its list while the one subsetting by event type does not.

It appears that when the default ListenerRetriever class is iterating over the listenerBeanNames the add call should be protected by a !allListeners.contains(listener) check like the event subset method is.

Attached is a zip file which shows the two listeners printed from the no parameter method while only one is printed from the event type method.


Affects: 3.0 GA, 3.0.1, 3.0.2

Attachments:

Referenced from: commits 738d84f

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions