From 72fb82c01f47cb87f2bd4f2edff2b090cd2bb3a7 Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 22 Apr 2020 18:42:26 +0800 Subject: [PATCH] Remove MPP EventCancelledException --- .../kotlin/net.mamoe.mirai/event/events/BotEvents.kt | 10 +++++----- .../mirai/event/events/EventCancelledException.kt | 12 ------------ 2 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/events/EventCancelledException.kt diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt index e12906230..ec3d50824 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt @@ -34,11 +34,11 @@ import kotlin.jvm.JvmSynthetic @Suppress("unused") -expect class EventCancelledException : RuntimeException { - constructor() - constructor(message: String?) - constructor(message: String?, cause: Throwable?) - constructor(cause: Throwable?) +class EventCancelledException : RuntimeException { + constructor() : super() + constructor(message: String?) : super(message) + constructor(message: String?, cause: Throwable?) : super(message, cause) + constructor(cause: Throwable?) : super(cause) } // note: 若你使用 IntelliJ IDEA, 按 alt + 7 可打开结构 diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/events/EventCancelledException.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/events/EventCancelledException.kt deleted file mode 100644 index 9dffc3b61..000000000 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/events/EventCancelledException.kt +++ /dev/null @@ -1,12 +0,0 @@ -package net.mamoe.mirai.event.events - - -// 不要删除多平台结构. -// 否则在 Java 中这个 class 不会被认为是 java.lang.RuntimeException (Kotlin bug) -@Suppress("unused") -actual class EventCancelledException : RuntimeException { - actual constructor() : super() - actual constructor(message: String?) : super(message) - actual constructor(message: String?, cause: Throwable?) : super(message, cause) - actual constructor(cause: Throwable?) : super(cause) -} \ No newline at end of file