Closed
Description
Phil Webb opened SPR-16435 and commented
I recently extracted the lambda class error detection logic into a dedicated util in Spring Boot and added a lot of additional tests.
Interestingly, the tests failed on JDK 9 with the following:
ERROR] callbacksInvokeWhenMultipleShouldInvokeSuitable(org.springframework.boot.util.LambdaSafeTests) Time elapsed: 0 s <<< ERROR!
java.lang.ClassCastException: java.base/java.lang.String cannot be cast to java.base/java.lang.StringBuilder
I appears that the format of the ClassCastException
has changed and it now includes the module name. I've attempted to fix this in Spring Boot by including the module name, but since this code also appears in framework I thought you might have the same issue.
Affects: 4.3.14, 5.0.3
Issue Links:
- SimpleApplicationEventMulticaster should not generally suppress ClassCastException [SPR-14846] #19412 SimpleApplicationEventMulticaster should not generally suppress ClassCastException
- SimpleApplicationEventMulticaster should not rely on ClassCastException having a message [SPR-15145] #19711 SimpleApplicationEventMulticaster should not rely on ClassCastException having a message
- Classification of ClassCastExceptions doesn't work in JDK 11 (OpenJDK) [SPR-17093] #21630 Classification of ClassCastExceptions doesn't work in JDK 11 (OpenJDK)
Referenced from: commits b125b5e, 89d2bd9
Backported to: 4.3.15