From 13a0444244bd5077f17d49f78ab7ad97b55f1faa Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 20 Sep 2020 21:35:31 +0800 Subject: [PATCH] Fix deprecation message on PluginData implementations --- .../net/mamoe/mirai/console/data/AutoSavePluginConfig.kt | 2 +- .../net/mamoe/mirai/console/data/AutoSavePluginData.kt | 6 +++--- .../mamoe/mirai/console/data/java/JAutoSavePluginConfig.kt | 2 +- .../mamoe/mirai/console/data/java/JAutoSavePluginData.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginConfig.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginConfig.kt index df4a4c280..1e3793e5a 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginConfig.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginConfig.kt @@ -24,7 +24,7 @@ import kotlinx.coroutines.Job * @see AutoSavePluginData */ public open class AutoSavePluginConfig : AutoSavePluginData, PluginConfig { - @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginConfig(\"改成保存的名称\")")) + @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginConfig(\"把我改成保存名称\")")) @Suppress("DEPRECATION_ERROR") public constructor() : super() diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginData.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginData.kt index 06410a113..a8405df03 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginData.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/AutoSavePluginData.kt @@ -30,7 +30,7 @@ import kotlin.reflect.full.findAnnotation * @see PluginData */ public open class AutoSavePluginData private constructor( - @Suppress("UNUSED_PARAMETER") primaryConstructorMark: Any? + @Suppress("UNUSED_PARAMETER") primaryConstructorMark: Any?, ) : AbstractPluginData() { private lateinit var owner_: AutoSavePluginDataHolder private val autoSaveIntervalMillis_: LongRange get() = owner_.autoSaveIntervalMillis @@ -45,7 +45,7 @@ public open class AutoSavePluginData private constructor( _saveName = saveName } - @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginConfig")) + @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginData(\"把我改成保存名称\")")) public constructor() : this(null) { val clazz = this::class _saveName = clazz.findAnnotation()?.value @@ -72,7 +72,7 @@ public open class AutoSavePluginData private constructor( ?.let { return@invokeOnCompletion } MiraiConsole.mainLogger.error( "An exception occurred when saving config ${this@AutoSavePluginData::class.qualifiedNameOrTip} " + - "but CoroutineExceptionHandler not found in PluginDataHolder.coroutineContext for ${owner::class.qualifiedNameOrTip}", + "but CoroutineExceptionHandler not found in PluginDataHolder.coroutineContext for ${owner::class.qualifiedNameOrTip}", e ) } diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginConfig.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginConfig.kt index 5d9788dd1..1ca820466 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginConfig.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginConfig.kt @@ -38,7 +38,7 @@ import net.mamoe.mirai.console.data.PluginData * @see PluginConfig */ public abstract class JAutoSavePluginConfig : AutoSavePluginConfig, PluginConfig { - @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginConfig(\"改成保存的名称\")")) + @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("JAutoSavePluginConfig(\"把我改成保存名称\")")) @Suppress("DEPRECATION_ERROR") public constructor() : super() diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginData.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginData.kt index ec2986fbc..442f19cc9 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginData.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/data/java/JAutoSavePluginData.kt @@ -67,7 +67,7 @@ import kotlin.reflect.full.createType * @see PluginData */ public abstract class JAutoSavePluginData : AutoSavePluginData, PluginConfig { - @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("AutoSavePluginConfig(\"改成保存的名称\")")) + @Deprecated("请手动指定保存名称. 此构造器将在 1.0.0 删除", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("JAutoSavePluginData(\"把我改成保存名称\")")) @Suppress("DEPRECATION_ERROR") public constructor() : super()