Add errorprone and fix warnings/errors

The compiler will also treat all warnings as errors from now on.
This commit is contained in:
Alexander Söderberg 2020-10-23 10:20:45 +02:00 committed by Alexander Söderberg
parent 6ffee9d04f
commit cfac2639ad
101 changed files with 309 additions and 146 deletions

View file

@ -48,7 +48,6 @@ public final class BungeeCommand<C> extends Command implements TabExecutor {
private final BungeeCommandManager<C> manager;
private final CommandArgument<C, ?> command;
private final cloud.commandframework.Command<C> cloudCommand;
@SuppressWarnings("unchecked")
BungeeCommand(
@ -63,7 +62,6 @@ public final class BungeeCommand<C> extends Command implements TabExecutor {
);
this.command = command;
this.manager = manager;
this.cloudCommand = cloudCommand;
}
@Override
@ -78,7 +76,7 @@ public final class BungeeCommand<C> extends Command implements TabExecutor {
sender,
builder.toString()
)
.whenComplete(((commandResult, throwable) -> {
.whenComplete((commandResult, throwable) -> {
if (throwable != null) {
if (throwable instanceof CompletionException) {
throwable = throwable.getCause();
@ -154,7 +152,7 @@ public final class BungeeCommand<C> extends Command implements TabExecutor {
throwable.printStackTrace();
}
}
}));
});
}
@Override

View file

@ -63,6 +63,7 @@ public class BungeeCommandManager<C> extends CommandManager<C> {
* @param commandSenderMapper Function that maps {@link CommandSender} to the command sender type
* @param backwardsCommandSenderMapper Function that maps the command sender type to {@link CommandSender}
*/
@SuppressWarnings("unchecked")
public BungeeCommandManager(
final @NonNull Plugin owningPlugin,
final @NonNull Function<@NonNull CommandTree<C>,

View file

@ -31,7 +31,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
* Command preprocessor which decorates incoming {@link cloud.commandframework.context.CommandContext}
* with Bungee specific objects
*
* @param <C>
* @param <C> Command sender type
* @since 1.1.0
*/
final class BungeeCommandPreprocessor<C> implements CommandPreprocessor<C> {

View file

@ -184,6 +184,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
public static final class PlayerParseException extends ParserException {
private static final long serialVersionUID = -2685136673577959929L;
private PlayerParseException(
final @NonNull String input,
final @NonNull CommandContext<?> context

View file

@ -172,6 +172,8 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
public static final class ServerParseException extends ParserException {
private static final long serialVersionUID = -3825941611365494659L;
private ServerParseException(
final @NonNull String input,
final @NonNull CommandContext<?> context