-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
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 ApplicationListener
s 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:
- GenericTypeResolver returns Object for parameterized parameters [SPR-7389] #12047 GenericTypeResolver returns Object for parameterized parameters
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug