From bac96e3927af2a92b3147ad6c9c7fb0c3f2aca10 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 15 Feb 2018 15:21:41 +0300 Subject: [PATCH] Fix exception contructors to match JVM/JS signatures. (#1329) --- runtime/src/main/kotlin/kotlin/Exceptions.kt | 153 +++++++------------ 1 file changed, 53 insertions(+), 100 deletions(-) diff --git a/runtime/src/main/kotlin/kotlin/Exceptions.kt b/runtime/src/main/kotlin/kotlin/Exceptions.kt index 49587514eb2..834c2973636 100644 --- a/runtime/src/main/kotlin/kotlin/Exceptions.kt +++ b/runtime/src/main/kotlin/kotlin/Exceptions.kt @@ -18,207 +18,160 @@ package kotlin public open class Error : Throwable { - constructor() : super() { - } + constructor() : super() - constructor(message: String) : super(message) { - } + constructor(message: String?) : super(message) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public open class Exception : Throwable { - constructor() : super() { - } + constructor() : super() - constructor(message: String) : super(message) { - } + constructor(message: String?) : super(message) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public open class RuntimeException : Exception { - constructor() : super() { - } + constructor() : super() - constructor(message: String) : super(message) { - } + constructor(message: String?) : super(message) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public class NullPointerException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class NoSuchElementException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class IllegalArgumentException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public open class IllegalStateException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public open class UnsupportedOperationException : RuntimeException { - constructor() { - } + constructor() - constructor(message: String) : super(message) { - } + constructor(message: String?) : super(message) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) - constructor(cause: Throwable) : super(cause) { - } + constructor(cause: Throwable?) : super(cause) } public open class IndexOutOfBoundsException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class ArrayIndexOutOfBoundsException : IndexOutOfBoundsException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class ClassCastException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class TypeCastException : ClassCastException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class ArithmeticException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class AssertionError : Error { - constructor() { - } + constructor() - constructor(message: String) : super(message) { - } + constructor(message: String?) : super(message) - constructor(message: Any) : super(message.toString()) { - } + constructor(message: Any?) : super(message.toString()) - constructor(message: String, cause: Throwable) : super(message, cause) { - } + constructor(message: String?, cause: Throwable?) : super(message, cause) } public open class NoWhenBranchMatchedException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class UninitializedPropertyAccessException : RuntimeException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class OutOfMemoryError : Error { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) { - } + constructor(s: String?) : super(s) } public open class NumberFormatException : IllegalArgumentException { - constructor() : super() { - } + constructor() : super() - constructor(s: String) : super(s) {} + constructor(s: String?) : super(s) } public open class IllegalCharacterConversionException : IllegalArgumentException { + constructor(): super() - constructor(s: String) : super(s) + + constructor(s: String?) : super(s) } \ No newline at end of file