SimpleApplicationEventMulticaster should not rely on ClassCastException having a message [SPR-15145] #19711
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Mariusz Luciow opened SPR-15145 and commented
SimpleApplicationEventMulticaster in this commit driven by #19412 changed the ClassCastException catch logic to:
Note that if ex.getMessage() returns NULL whole method will throw NPE.
To speed up execution of methods that frequently throw exceptions, the C2 compiler generates code that uses a pre-built exception (pre-built at compile time). The pre-built exception does not contain neither a stack trace nor a message detailing the exception.
This means that after some time the compiler can replace normal ClassCastException with empty one, without message nor stack trace.
More detailed explanation of this behaviour can be found here:
There should be a check in place to ensure that message is not null.
Affects: 4.3.5
Reference URL: 13001b9#diff-2434dcbaad29ced6a104bb6523c4f67e
Issue Links:
Referenced from: commits 976d32f, 153fd82, 64d4afa, 0655d73
The text was updated successfully, but these errors were encountered: