From 976d32fc5943a11668b12e83621feaa197677ec4 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 17 Jan 2017 20:37:20 +0100 Subject: [PATCH] SimpleApplicationEventMulticaster defensively swallows ClassCastException without message Issue: SPR-15145 --- .../context/event/SimpleApplicationEventMulticaster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java b/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java index 9fc78676c6b..72ae81ec5a2 100644 --- a/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java +++ b/spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java @@ -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()) {