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 @@ final class CloudburstCommand<C> extends PluginCommand<Plugin> {
private final CommandArgument<C, ?> command;
private final CloudburstCommandManager<C> manager;
private final Command<C> cloudCommand;
CloudburstCommand(
final @NonNull String label,
@ -64,7 +63,6 @@ final class CloudburstCommand<C> extends PluginCommand<Plugin> {
.build());
this.command = command;
this.manager = manager;
this.cloudCommand = cloudCommand;
}
@Override
@ -83,7 +81,7 @@ final class CloudburstCommand<C> extends PluginCommand<Plugin> {
sender,
builder.toString()
)
.whenComplete(((commandResult, throwable) -> {
.whenComplete((commandResult, throwable) -> {
if (throwable != null) {
if (throwable instanceof CompletionException) {
throwable = throwable.getCause();
@ -131,7 +129,7 @@ final class CloudburstCommand<C> extends PluginCommand<Plugin> {
throwable.printStackTrace();
}
}
}));
});
return true;
}

View file

@ -54,6 +54,7 @@ public class CloudburstCommandManager<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 CloudburstCommandManager(
final @NonNull Plugin owningPlugin,
final @NonNull Function<@NonNull CommandTree<C>,

View file

@ -48,6 +48,7 @@ class CloudburstPluginRegistrationHandler<C> implements CommandRegistrationHandl
}
@Override
@SuppressWarnings("unchecked")
public final boolean registerCommand(final @NonNull Command<?> command) {
/* We only care about the root command argument */
final CommandArgument<?, ?> commandArgument = command.getArguments().get(0);