From faedd76b32af2e299cd94bd2beb96de49b7d8281 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Wed, 7 Sep 2022 22:22:29 +0300 Subject: [PATCH] Remove deprecation from ConcurrentModificationException constructors #KT-53927 The constructors were introduced in jdk7, thus their usage was prohibited in Common code. Now that jvmTarget is 1.8 and jdk8+ is used to compile stdlib, these constructors are available on all platforms. --- libraries/stdlib/common/src/kotlin/ExceptionsH.kt | 2 -- libraries/stdlib/test/exceptions/ExceptionTest.kt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/stdlib/common/src/kotlin/ExceptionsH.kt b/libraries/stdlib/common/src/kotlin/ExceptionsH.kt index bc036badd6b..ee48cdd6533 100644 --- a/libraries/stdlib/common/src/kotlin/ExceptionsH.kt +++ b/libraries/stdlib/common/src/kotlin/ExceptionsH.kt @@ -49,9 +49,7 @@ public expect open class IndexOutOfBoundsException : RuntimeException { public expect open class ConcurrentModificationException : RuntimeException { constructor() constructor(message: String?) - @Deprecated("The constructor is not supported on all platforms and will be removed from kotlin-stdlib-common soon.", level = DeprecationLevel.ERROR) constructor(message: String?, cause: Throwable?) - @Deprecated("The constructor is not supported on all platforms and will be removed from kotlin-stdlib-common soon.", level = DeprecationLevel.ERROR) constructor(cause: Throwable?) } diff --git a/libraries/stdlib/test/exceptions/ExceptionTest.kt b/libraries/stdlib/test/exceptions/ExceptionTest.kt index 49fb408c02c..789ea14bf9c 100644 --- a/libraries/stdlib/test/exceptions/ExceptionTest.kt +++ b/libraries/stdlib/test/exceptions/ExceptionTest.kt @@ -23,7 +23,7 @@ class ExceptionTest { @Test fun nullPointerException() = testCreateException(::NullPointerException, ::NullPointerException) @Test fun classCastException() = testCreateException(::ClassCastException, ::ClassCastException) @Test fun noSuchElementException() = testCreateException(::NoSuchElementException, ::NoSuchElementException) - @Test fun concurrentModificationException() = testCreateException(::ConcurrentModificationException, ::ConcurrentModificationException) + @Test fun concurrentModificationException() = testCreateException(::ConcurrentModificationException, ::ConcurrentModificationException, ::ConcurrentModificationException, ::ConcurrentModificationException) @Test fun arithmeticException() = testCreateException(::ArithmeticException, ::ArithmeticException) @Test fun noWhenBranchMatchedException() = @Suppress("DEPRECATION_ERROR") testCreateException(::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException)