From 32eb098f783a50a99fdf3667e8972113dbef5d80 Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 16 Nov 2020 15:56:53 +0800 Subject: [PATCH] Require not null message for IllegalCommandArgumentException --- .../src/command/IllegalCommandArgumentException.kt | 10 ++++------ .../mirai-console/src/command/descriptor/Exceptions.kt | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/backend/mirai-console/src/command/IllegalCommandArgumentException.kt b/backend/mirai-console/src/command/IllegalCommandArgumentException.kt index adc2d785b..40ef86d16 100644 --- a/backend/mirai-console/src/command/IllegalCommandArgumentException.kt +++ b/backend/mirai-console/src/command/IllegalCommandArgumentException.kt @@ -23,9 +23,7 @@ import net.mamoe.mirai.console.command.descriptor.CommandArgumentParserException * * @see CommandArgumentParserException */ -public open class IllegalCommandArgumentException : IllegalArgumentException { - public constructor() : super() - public constructor(message: String?) : super(message) - public constructor(message: String?, cause: Throwable?) : super(message, cause) - public constructor(cause: Throwable?) : super(cause) -} +public open class IllegalCommandArgumentException @JvmOverloads constructor( + message: String, + cause: Throwable? = null, +) : IllegalArgumentException(message, cause) \ No newline at end of file diff --git a/backend/mirai-console/src/command/descriptor/Exceptions.kt b/backend/mirai-console/src/command/descriptor/Exceptions.kt index 434983625..4a93152ab 100644 --- a/backend/mirai-console/src/command/descriptor/Exceptions.kt +++ b/backend/mirai-console/src/command/descriptor/Exceptions.kt @@ -58,9 +58,7 @@ public open class CommandDeclarationException : RuntimeException { * @see CommandValueArgumentParser * @see AbstractCommandValueArgumentParser.illegalArgument */ -public class CommandArgumentParserException : IllegalCommandArgumentException { - public constructor() : super() - public constructor(message: String?) : super(message) - public constructor(message: String?, cause: Throwable?) : super(message, cause) - public constructor(cause: Throwable?) : super(cause) -} \ No newline at end of file +public class CommandArgumentParserException @JvmOverloads constructor( + message: String, + cause: Throwable? = null, +) : IllegalCommandArgumentException(message, cause) \ No newline at end of file