Introduce ConcurrentModificationException typealias in stdlib/jvm
This is required to provide the corresponding expect exception in stdlib/common. Raise deprecation level for constructors declared in common but unsupported in JVM. #KT-26598
This commit is contained in:
@@ -46,13 +46,12 @@ public expect open class IndexOutOfBoundsException : RuntimeException {
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
@Suppress("NO_ACTUAL_FOR_EXPECT") // TODO: Introduce typealias in JVM
|
||||
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.")
|
||||
@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.")
|
||||
@Deprecated("The constructor is not supported on all platforms and will be removed from kotlin-stdlib-common soon.", level = DeprecationLevel.ERROR)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,4 +24,7 @@ package kotlin
|
||||
|
||||
@SinceKotlin("1.1") public actual typealias NoSuchElementException = java.util.NoSuchElementException
|
||||
|
||||
@Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS")
|
||||
@SinceKotlin("1.3") public actual typealias ConcurrentModificationException = java.util.ConcurrentModificationException
|
||||
|
||||
@SinceKotlin("1.1") public actual typealias Comparator<T> = java.util.Comparator<T>
|
||||
|
||||
@@ -22,6 +22,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 arithmeticException() = testCreateException(::ArithmeticException, ::ArithmeticException)
|
||||
|
||||
@Test fun noWhenBranchMatchedException() = testCreateException(::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException)
|
||||
|
||||
Reference in New Issue
Block a user