From ce078aad70751755dd1532cceb9daf2532970681 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 24 Aug 2020 21:29:34 -0400 Subject: [PATCH] Updated many exception classes --- .../bukkit/WorldUnloadedException.java | 18 ++++---- .../com/boydti/fawe/jnbt/NBTException.java | 2 +- .../util/commands/CommandException.java | 21 +++++----- .../commands/CommandPermissionsException.java | 18 ++++---- .../MissingNestedCommandException.java | 18 ++++---- .../commands/UnhandledCommandException.java | 18 ++++---- .../input/DisallowedUsageException.java | 41 +++++++++++++++---- .../extension/input/InputParseException.java | 40 ++++++++++++++---- .../extension/input/NoMatchException.java | 41 +++++++++++++++---- .../platform/NoCapablePlatformException.java | 18 ++++---- 10 files changed, 152 insertions(+), 83 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java index 22e910037..74c81153f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.worldedit.bukkit; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/NBTException.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/NBTException.java index c35221dd8..339e4b3bc 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/NBTException.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/NBTException.java @@ -6,7 +6,7 @@ public class NBTException extends RuntimeException { } /** - * Faster exception throwing if you don't fill the stacktrace + * Faster exception throwing if you don't fill the stacktrace. * * @return */ diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java index 8497e3f6b..d8a8ffb7c 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.minecraft.util.commands; @@ -22,13 +22,14 @@ package com.sk89q.minecraft.util.commands; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; + import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkNotNull; public class CommandException extends Exception { - private List commandStack = new ArrayList<>(); + private final List commandStack = new ArrayList<>(); public CommandException() { super(); diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissionsException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissionsException.java index d58def95e..c2f2e8614 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissionsException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandPermissionsException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.minecraft.util.commands; diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java index eab4b2cd8..290a29dff 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.minecraft.util.commands; diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/UnhandledCommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/UnhandledCommandException.java index 117d96963..d9eec5619 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/UnhandledCommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/UnhandledCommandException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.minecraft.util.commands; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/DisallowedUsageException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/DisallowedUsageException.java index 1a1bd9ba9..63f3e3b36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/DisallowedUsageException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/DisallowedUsageException.java @@ -3,22 +3,24 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.worldedit.extension.input; +import com.sk89q.worldedit.util.formatting.text.Component; + /** * Thrown when usage is disallowed. */ @@ -29,6 +31,16 @@ public class DisallowedUsageException extends InputParseException { * * @param message the message */ + public DisallowedUsageException(Component message) { + super(message); + } + + /** + * Create with a message. + * + * @param message the message + */ + @Deprecated public DisallowedUsageException(String message) { super(message); } @@ -39,6 +51,17 @@ public class DisallowedUsageException extends InputParseException { * @param message the message * @param cause the cause */ + public DisallowedUsageException(Component message, Throwable cause) { + super(message, cause); + } + + /** + * Create with a message and a cause. + * + * @param message the message + * @param cause the cause + */ + @Deprecated public DisallowedUsageException(String message, Throwable cause) { super(message, cause); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/InputParseException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/InputParseException.java index b714d5c37..27e06ff17 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/InputParseException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/InputParseException.java @@ -3,23 +3,24 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.worldedit.extension.input; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.util.formatting.text.Component; /** * Thrown when parsed input results in an error. @@ -31,6 +32,16 @@ public class InputParseException extends WorldEditException { * * @param message the message */ + public InputParseException(Component message) { + super(message); + } + + /** + * Throw with a message. + * + * @param message the message + */ + @Deprecated public InputParseException(String message) { super(message); } @@ -41,6 +52,17 @@ public class InputParseException extends WorldEditException { * @param message the message * @param cause the cause */ + public InputParseException(Component message, Throwable cause) { + super(message, cause); + } + + /** + * Throw with a message and a cause. + * + * @param message the message + * @param cause the cause + */ + @Deprecated public InputParseException(String message, Throwable cause) { super(message, cause); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/NoMatchException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/NoMatchException.java index f4010861a..7734816b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/NoMatchException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/NoMatchException.java @@ -3,22 +3,24 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.worldedit.extension.input; +import com.sk89q.worldedit.util.formatting.text.Component; + /** * Thrown when a match fails when input is parsed. */ @@ -29,6 +31,16 @@ public class NoMatchException extends InputParseException { * * @param message the message */ + public NoMatchException(Component message) { + super(message); + } + + /** + * Create with a message. + * + * @param message the message + */ + @Deprecated public NoMatchException(String message) { super(message); } @@ -39,6 +51,17 @@ public class NoMatchException extends InputParseException { * @param message the message * @param cause the cause */ + public NoMatchException(Component message, Throwable cause) { + super(message, cause); + } + + /** + * Create with a message and a cause. + * + * @param message the message + * @param cause the cause + */ + @Deprecated public NoMatchException(String message, Throwable cause) { super(message, cause); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/NoCapablePlatformException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/NoCapablePlatformException.java index c3e1019a7..d456206d7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/NoCapablePlatformException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/NoCapablePlatformException.java @@ -3,18 +3,18 @@ * Copyright (C) sk89q * Copyright (C) WorldEdit team and contributors * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.sk89q.worldedit.extension.platform;