diff --git a/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/AsserterLookup.kt b/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/AsserterLookup.kt index 961c00404e5..1ca12800b69 100644 --- a/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/AsserterLookup.kt +++ b/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/AsserterLookup.kt @@ -23,8 +23,7 @@ internal fun lookup(): Asserter { private fun initContributors() { contributors.clear() - @Suppress("DEPRECATION") - val loader = ServiceLoader.load(AsserterContributor::class.javaClass) + val loader = ServiceLoader.load(AsserterContributor::class.java) for (contributor in loader) { if (contributor != null) { diff --git a/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/TestAssertionsJVM.kt b/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/TestAssertionsJVM.kt index d4dedfdec96..6af15cab26b 100644 --- a/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/TestAssertionsJVM.kt +++ b/libraries/kotlin.test/shared/src/main/kotlin.jvm/kotlin/test/TestAssertionsJVM.kt @@ -2,7 +2,6 @@ @file:kotlin.jvm.JvmName("TestAssertionsKt") package kotlin.test -import kotlin.jvm.internal.* import kotlin.reflect.* @Deprecated("Use assertFailsWith instead.", ReplaceWith("assertFailsWith(exceptionClass, block)"), kotlin.DeprecationLevel.ERROR) @@ -34,14 +33,12 @@ fun assertFailsWith(exceptionClass: Class, message: String?, fun assertFailsWith(exceptionClass: KClass, block: () -> Unit): T = assertFailsWith(exceptionClass, null, block) /** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */ -@Suppress("DEPRECATION") -fun assertFailsWith(exceptionClass: KClass, message: String?, block: () -> Unit): T = assertFailsWith(exceptionClass.javaClass, message, block) +fun assertFailsWith(exceptionClass: KClass, message: String?, block: () -> Unit): T = assertFailsWith(exceptionClass.java, message, block) /** Asserts that a [block] fails with a specific exception of type [T] being thrown. * Since inline method doesn't allow to trace where it was invoked, it is required to pass a [message] to distinguish this method call from others. */ -@Suppress("DEPRECATION") -inline fun assertFailsWith(message: String, noinline block: () -> Unit): T = assertFailsWith(T::class.javaClass, message, block) +inline fun assertFailsWith(message: String, noinline block: () -> Unit): T = assertFailsWith(T::class.java, message, block) /** @@ -62,12 +59,3 @@ inline fun currentStackTrace() = (java.lang.Exception() as java.lang.Throwable). val asserter: Asserter get() = lookup() - -/** - * Returns a Java [Class] instance corresponding to the given [KClass] instance. - */ -@Suppress("UNCHECKED_CAST") -@Intrinsic("kotlin.KClass.java.property") -@Deprecated("This is for internal use only", ReplaceWith("this.java"), kotlin.DeprecationLevel.WARNING) -val KClass.javaClass: Class - get() = (this as ClassBasedDeclarationContainer).jClass as Class