Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda error detection might not work on JDK 9 [SPR-16435] #20981

Closed
spring-projects-issues opened this issue Jan 30, 2018 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 30, 2018

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:

Referenced from: commits b125b5e, 89d2bd9

Backported to: 4.3.15

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Since we only need this in SimpleApplicationEventMulticaster for a very specific purpose and do some over-swallowing for ClassCastExceptions without a message already, I'll add the simplest possible check here: the exception message either starting with the event class name or containing the event class name after the first occurence of a slash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants