From dda2f010518f3cb34ed79b92dfca3289a8ebc9b6 Mon Sep 17 00:00:00 2001 From: Philip Wedemann <22521688+hfhbd@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:44:35 +0100 Subject: [PATCH] Extend UUIDFormatException from IllegalArgumentException (#259) Co-authored-by: hfhbd --- kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUID.kt | 2 +- .../src/commonMain/kotlin/kotlinx/uuid/UUIDFormatException.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUID.kt b/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUID.kt index a305902..5b1670c 100644 --- a/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUID.kt +++ b/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUID.kt @@ -203,7 +203,7 @@ public class UUID private constructor( return UUID(timeStampAndVersionRaw, clockSequenceVariantAndNodeRaw) } - private fun versionFor(id: Int): Version? = Version.values().firstOrNull { it.id == id } + private fun versionFor(id: Int): Version? = Version.entries.firstOrNull { it.id == id } } } diff --git a/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUIDFormatException.kt b/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUIDFormatException.kt index 4b48e44..c9a2c48 100644 --- a/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUIDFormatException.kt +++ b/kotlinx-uuid-core/src/commonMain/kotlin/kotlinx/uuid/UUIDFormatException.kt @@ -1,3 +1,3 @@ package kotlinx.uuid -internal class UUIDFormatException(override val message: String) : Exception(message) +internal class UUIDFormatException(override val message: String) : IllegalArgumentException(message)