-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Exclude sealed interfaces from auto-proxying (for JDK 17 compatibility) #27027
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
Comments
It seems sufficient to exclude sealed interfaces through a reflective |
I will give it a try tomorrow. Thanks @jhoeller |
Seems to work just fine for the failing test in Boot. |
Cool, thanks for the quick turnaround! |
@jhoeller Should sealed interfaces be filtered here? spring-framework/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactory.java Line 51 in b595dc1
|
What about Kotlin sealed classes? Also note that for kotlin reflection might not be needed in the future https://youtrack.jetbrains.com/issue/KT-25871 Maybe that none of those things are relevant (haven't looked into this issue) but I wanted to share this, just in case |
Hi,
I recently opened an issue to track the needed stuff for Spring-Boot in order to support Java 17. spring-projects/spring-boot#26767. I think it makes sense to have the same for Spring Framework.
Known issues:
Essentially, under the hood it retrieves all interfaces of
String
here which also includesConstantDesc
which is a sealed interface and cannot be used when creating a proxy. SeeScopedProxyFactoryBean.setBeanFactory
:After a first look this probably needs to be handled more centrally and more places are potentially affected by sealed interfaces.
There is likely more to do for Java 17 support, but I wanted to kick this off. Feel free to add to this issue or repurpose it to only handle the specific issue.
Let me know if I can help.
Cheers,
Christoph
The text was updated successfully, but these errors were encountered: