Replace uses of deprecated javaClass
diff --git a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CoroutineScope.kt b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CoroutineScope.kt
index 38bae0e..e9623c0 100644
--- a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CoroutineScope.kt
+++ b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CoroutineScope.kt
@@ -94,6 +94,6 @@
override fun toString(): String {
val state = getState()
val result = if (state is Incomplete) "" else "[$state]"
- return "${javaClass.simpleName}{${describeState(state)}}$result@${Integer.toHexString(System.identityHashCode(this))}"
+ return "${this::class.java.simpleName}{${describeState(state)}}$result@${Integer.toHexString(System.identityHashCode(this))}"
}
}
diff --git a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Job.kt b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Job.kt
index cb8623e..a46341b 100644
--- a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Job.kt
+++ b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Job.kt
@@ -343,8 +343,9 @@
// otherwise -- do nothing (it was Empty*)
else -> check(expect is Empty)
}
- // Do other (overridable) processing after completion handlers
+ // handle onCompletion exceptions
completionException?.let { handleCompletionException(it) }
+ // Do other (overridable) processing after completion handlers
afterCompletion(update)
}
@@ -497,7 +498,7 @@
?: InvokeOnCompletion(this, handler)
// for nicer debugging
- override fun toString(): String = "${javaClass.simpleName}{${describeState(state)}}@${Integer.toHexString(System.identityHashCode(this))}"
+ override fun toString(): String = "${this::class.java.simpleName}{${describeState(state)}}@${Integer.toHexString(System.identityHashCode(this))}"
/**
* Interface for incomplete [state][getState] of a job.
@@ -548,7 +549,7 @@
_exception ?: // atomic read volatile var or else create new
CancellationException("Job was cancelled").also { _exception = it }
- override fun toString(): String = "${javaClass.simpleName}[$exception]"
+ override fun toString(): String = "${this::class.java.simpleName}[$exception]"
}
/**
@@ -579,7 +580,7 @@
val handler: CompletionHandler
) : JobNode(job) {
override fun invoke(reason: Throwable?) = handler.invoke(reason)
- override fun toString() = "InvokeOnCompletion[${handler.javaClass.name}@${Integer.toHexString(System.identityHashCode(handler))}]"
+ override fun toString() = "InvokeOnCompletion[${handler::class.java.name}@${Integer.toHexString(System.identityHashCode(handler))}]"
}
private class ResumeOnCompletion(