Fixed compile warnings
This commit is contained in:
parent
5f228cf7b4
commit
d4d8ddefc1
|
@ -130,7 +130,7 @@ class RmiSpamSyncSuspendingTest : BaseTest() {
|
||||||
|
|
||||||
private class TestObjectImpl(private val counter: AtomicLong) : TestObject {
|
private class TestObjectImpl(private val counter: AtomicLong) : TestObject {
|
||||||
@Override
|
@Override
|
||||||
override suspend fun setOther(aFloat: Long): Boolean {
|
override suspend fun setOther(value: Long): Boolean {
|
||||||
counter.getAndIncrement()
|
counter.getAndIncrement()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,10 @@ class SuspendProxyTest : TestCase() {
|
||||||
|
|
||||||
class SuspendHandler(private val delegate:Adder):InvocationHandler {
|
class SuspendHandler(private val delegate:Adder):InvocationHandler {
|
||||||
override fun invoke(proxy: Any, method: Method, arguments: Array<Any>): Any {
|
override fun invoke(proxy: Any, method: Method, arguments: Array<Any>): Any {
|
||||||
val suspendCoroutineObject = arguments?.lastOrNull()
|
val suspendCoroutineObject = arguments.lastOrNull()
|
||||||
return if (suspendCoroutineObject is Continuation<*>) {
|
return if (suspendCoroutineObject is Continuation<*>) {
|
||||||
val parameters = arguments.copyOf(arguments.size - 1)
|
val parameters = arguments.copyOf(arguments.size - 1)
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
val continuation = suspendCoroutineObject as Continuation<Any?>
|
val continuation = suspendCoroutineObject as Continuation<Any?>
|
||||||
val retVal = method.invoke(delegate, *parameters, Continuation<Any?>(EmptyCoroutineContext) {
|
val retVal = method.invoke(delegate, *parameters, Continuation<Any?>(EmptyCoroutineContext) {
|
||||||
val continuationResult = it.getOrNull()
|
val continuationResult = it.getOrNull()
|
||||||
|
@ -30,8 +31,7 @@ class SuspendProxyTest : TestCase() {
|
||||||
|
|
||||||
retVal
|
retVal
|
||||||
} else {
|
} else {
|
||||||
val parameters = arguments ?: arrayOf()
|
method.invoke(delegate, *arguments)
|
||||||
method.invoke(delegate, *parameters)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user