SimpleApplicationEventMulticaster defensively swallows ClassCastException without message

Issue: SPR-15145
(cherry picked from commit 976d32f)
This commit is contained in:
Juergen Hoeller 2017-01-17 20:37:20 +01:00
parent 48f57e3bb2
commit 64d4afad9f
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
}
catch (ClassCastException ex) {
String msg = ex.getMessage();
if (msg != null && msg.startsWith(event.getClass().getName())) {
if (msg == null || msg.startsWith(event.getClass().getName())) {
// Possibly a lambda-defined listener which we could not resolve the generic event type for
Log logger = LogFactory.getLog(getClass());
if (logger.isDebugEnabled()) {