Browse Source

SimpleApplicationEventMulticaster defensively swallows ClassCastException without message

Issue: SPR-15145
pull/1288/merge
Juergen Hoeller 9 years ago
parent
commit
976d32fc59
  1. 2
      spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java

2
spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java

@ -168,7 +168,7 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM @@ -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()) {

Loading…
Cancel
Save