Fixed compile warnings

This commit is contained in:
nathan 2020-09-11 11:06:03 +02:00
parent 5f228cf7b4
commit d4d8ddefc1
2 changed files with 4 additions and 4 deletions

View File

@ -130,7 +130,7 @@ class RmiSpamSyncSuspendingTest : BaseTest() {
private class TestObjectImpl(private val counter: AtomicLong) : TestObject {
@Override
override suspend fun setOther(aFloat: Long): Boolean {
override suspend fun setOther(value: Long): Boolean {
counter.getAndIncrement()
return true
}

View File

@ -19,9 +19,10 @@ class SuspendProxyTest : TestCase() {
class SuspendHandler(private val delegate:Adder):InvocationHandler {
override fun invoke(proxy: Any, method: Method, arguments: Array<Any>): Any {
val suspendCoroutineObject = arguments?.lastOrNull()
val suspendCoroutineObject = arguments.lastOrNull()
return if (suspendCoroutineObject is Continuation<*>) {
val parameters = arguments.copyOf(arguments.size - 1)
@Suppress("UNCHECKED_CAST")
val continuation = suspendCoroutineObject as Continuation<Any?>
val retVal = method.invoke(delegate, *parameters, Continuation<Any?>(EmptyCoroutineContext) {
val continuationResult = it.getOrNull()
@ -30,8 +31,7 @@ class SuspendProxyTest : TestCase() {
retVal
} else {
val parameters = arguments ?: arrayOf()
method.invoke(delegate, *parameters)
method.invoke(delegate, *arguments)
}
}
}