-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Make Kotlin functions accessible in CoroutinesUtils #23840
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
Make Kotlin functions accessible in CoroutinesUtils #23840
Conversation
} | ||
else { | ||
ReflectionUtils.makeAccessible(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code for this has moved to the constructor of HandlerMethod
so this needs to be removed from here.
} | ||
else { | ||
ReflectionUtils.makeAccessible(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, the code for this has moved to the constructor of HandlerMethod
so this needs to be removed from here.
I'm wondering if these classes need to remain private, i.e. is this something we want to work? |
@rstoyanchev If you mean classe like That said, we can't modify
To
This will impact other @rstoyanchev Do you agree? Is it ok to target 5.3.x for that fix? |
We probably need to do the same thing on |
@sdeleuze I agree, as far as the changes to |
I applied the discussed changes via 8eb618b on |
After updating to spring-webflux 5.2 i noticed that
@ExceptionHandler
's in private Kotlin-Classes stopped working.After debbuging I found that this regression was introduced with kotlin-coroutines support for reactive Webflux and reactive Messaging handlers.
The Problem is that when converting Java methods to Kotlin functions the information if a method is accessible or not will not be copied and the Kotlin function has to be made accessible again via its
isAccessible
setter.For this I introduced a new very simple
KotlinReflectionUtils
class which bothInvocableHandlerMethod's
use when Kotlin is available. I'm not 100% sure if this is the best solution and if its worth to introduce a new utils class for this.