mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
SimpleApplicationEventMulticaster just swallows event downcast exceptions
Issue: SPR-14846
This commit is contained in:
+7
-2
@@ -166,8 +166,13 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
|
||||
listener.onApplicationEvent(event);
|
||||
}
|
||||
catch (ClassCastException ex) {
|
||||
// Possibly a lambda-defined listener which we could not resolve the generic event type for
|
||||
LogFactory.getLog(getClass()).debug("Non-matching event type for listener: " + listener, ex);
|
||||
if (ex.getMessage().startsWith(event.getClass().getName())) {
|
||||
// Possibly a lambda-defined listener which we could not resolve the generic event type for
|
||||
LogFactory.getLog(getClass()).debug("Non-matching event type for listener: " + listener, ex);
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user