diff --git a/kotlinx-coroutines-core/jvm/src/Exceptions.kt b/kotlinx-coroutines-core/jvm/src/Exceptions.kt index dafaaacbe3..58003ee8db 100644 --- a/kotlinx-coroutines-core/jvm/src/Exceptions.kt +++ b/kotlinx-coroutines-core/jvm/src/Exceptions.kt @@ -68,9 +68,6 @@ internal actual class JobCancellationException public actual constructor( other === this || other is JobCancellationException && other.message == message && other.job == job && other.cause == cause - override fun hashCode(): Int { - // since job is transient it is indeed nullable after deserialization - @Suppress("UNNECESSARY_SAFE_CALL") - return (message!!.hashCode() * 31 + (job?.hashCode() ?: 0)) * 31 + (cause?.hashCode() ?: 0) - } + override fun hashCode(): Int = + (message!!.hashCode() * 31 + job.hashCode()) * 31 + (cause?.hashCode() ?: 0) }