mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-10 17:29:17 +00:00
Support invoking bridged suspending functions in AopUtils
Closes gh-33045
This commit is contained in:
@@ -349,9 +349,10 @@ public abstract class AopUtils {
|
||||
|
||||
// Use reflection to invoke the method.
|
||||
try {
|
||||
ReflectionUtils.makeAccessible(method);
|
||||
return (coroutinesReactorPresent && KotlinDetector.isSuspendingFunction(method) ?
|
||||
KotlinDelegate.invokeSuspendingFunction(method, target, args) : method.invoke(target, args));
|
||||
Method originalMethod = BridgeMethodResolver.findBridgedMethod(method);
|
||||
ReflectionUtils.makeAccessible(originalMethod);
|
||||
return (coroutinesReactorPresent && KotlinDetector.isSuspendingFunction(originalMethod) ?
|
||||
KotlinDelegate.invokeSuspendingFunction(originalMethod, target, args) : originalMethod.invoke(target, args));
|
||||
}
|
||||
catch (InvocationTargetException ex) {
|
||||
// Invoked method threw a checked exception.
|
||||
|
||||
Reference in New Issue
Block a user