Skip to content

SimpleApplicationEventMulticaster does not filter ApplicationEvents correctly [SPR-5974] #10642

@spring-projects-issues

Description

@spring-projects-issues

Oliver Drotbohm opened SPR-5974 and commented

JavaDoc of ApplicationListener says:

"As of Spring 3.0, an ApplicationListener can generically declare the event type that it is interested in. When registered with a Spring ApplicationContext, events will be filtered accordingly, with the listener getting invoked for matching event objects only."

Despite that, SimpleApplicationEventMulticaster notifies all ApplicationListeners regardless of the type you paramterized it with (see multicastEvent(..). This leads to ClasCastExceptions when declaring a subtype of ApplicationEvent as parameter of ApplicationListener.


Affects: 3.0 M3

Issue Links:

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