From 8df3f28cb705cb4527fcf9e21cb68ebb24309968 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 4 Oct 2021 15:50:17 -0700 Subject: [PATCH] KotlinAnnotatedMethods: Hold onto filtered params --- .../kotlin/coroutines/KotlinAnnotatedMethods.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt b/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt index 95a71e2e..34ea6704 100644 --- a/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt +++ b/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt @@ -69,12 +69,14 @@ private class KotlinMethodCommandExecutionHandler( context: CommandMethodContext ) : MethodCommandExecutionHandler(context) { + private val paramsWithoutContinuation = parameters().filterNot { Continuation::class.java == it.type }.toTypedArray() + override fun executeFuture(commandContext: CommandContext): CompletableFuture { val instance = context().instance() val params = createParameterValues( commandContext, commandContext.flags(), - this.parameters().filterNot { Continuation::class.java == it.type }.toTypedArray() + paramsWithoutContinuation ) // We need to propagate exceptions to the caller.