From a1f67e347f3d5db0794c1be31003c12300506f7b Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 27 Dec 2017 17:56:30 +0300 Subject: [PATCH] Relax nullability of UninitializedPropertyAccessException constructor parameters To make it consistent with other exception types --- .../src/kotlin/UninitializedPropertyAccessException.kt | 6 +++--- libraries/stdlib/test/ExceptionTest.kt | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/runtime.jvm/src/kotlin/UninitializedPropertyAccessException.kt b/core/runtime.jvm/src/kotlin/UninitializedPropertyAccessException.kt index 29e350f8be4..e48c0c6287e 100644 --- a/core/runtime.jvm/src/kotlin/UninitializedPropertyAccessException.kt +++ b/core/runtime.jvm/src/kotlin/UninitializedPropertyAccessException.kt @@ -19,9 +19,9 @@ package kotlin public class UninitializedPropertyAccessException : RuntimeException { 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) } diff --git a/libraries/stdlib/test/ExceptionTest.kt b/libraries/stdlib/test/ExceptionTest.kt index 87dd379aed9..40cc7c43aa4 100644 --- a/libraries/stdlib/test/ExceptionTest.kt +++ b/libraries/stdlib/test/ExceptionTest.kt @@ -35,9 +35,7 @@ class ExceptionTest { @Test fun noSuchElementException() = testCreateException(::NoSuchElementException, ::NoSuchElementException) @Test fun noWhenBranchMatchedException() = testCreateException(::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException, ::NoWhenBranchMatchedException) - - // TODO: Sort out with nullability of the parameters - // @Test fun uninitializedPropertyAccessException() = testCreateException(::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException) + @Test fun uninitializedPropertyAccessException() = testCreateException(::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException, ::UninitializedPropertyAccessException) @Test fun assertionError() = testCreateException(::AssertionError, ::AssertionError, ::AssertionError)