Skip to content

Commit

Permalink
Polishing (aligned with main)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Mar 19, 2024
1 parent c531a8a commit bd27ddf
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.Objects;

import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
Expand Down Expand Up @@ -93,8 +92,7 @@ public static <T> Deferred<T> monoToDeferred(Mono<T> source) {
* @return the method invocation result as reactive stream
* @throws IllegalArgumentException if {@code method} is not a suspending function
*/
public static Publisher<?> invokeSuspendingFunction(Method method, Object target,
Object... args) {
public static Publisher<?> invokeSuspendingFunction(Method method, Object target, Object... args) {
return invokeSuspendingFunction(Dispatchers.getUnconfined(), method, target, args);
}

Expand All @@ -115,7 +113,8 @@ public static Publisher<?> invokeSuspendingFunction(
CoroutineContext context, Method method, @Nullable Object target, Object... args) {

Assert.isTrue(KotlinDetector.isSuspendingFunction(method), "Method must be a suspending function");
KFunction<?> function = Objects.requireNonNull(ReflectJvmMapping.getKotlinFunction(method));
KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method);
Assert.notNull(function, () -> "Failed to get Kotlin function for method: " + method);
if (method.isAccessible() && !KCallablesJvm.isAccessible(function)) {
KCallablesJvm.setAccessible(function, true);
}
Expand Down

0 comments on commit bd27ddf

Please sign in to comment.