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

@ -68,6 +68,7 @@ public final class CloudInjectionModule<C> extends AbstractModule {
}
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
protected void configure() {
final Type commandTreeType = Types.newParameterizedType(CommandTree.class, this.commandSenderType);
final Type commandExecutionCoordinatorType = Types.newParameterizedType(CommandExecutionCoordinator.class,

View file

@ -77,6 +77,7 @@ public class VelocityCommandManager<C> extends CommandManager<C> {
* @param backwardsCommandSenderMapper Function that maps the command sender type to {@link CommandSource}
*/
@Inject
@SuppressWarnings("unchecked")
public VelocityCommandManager(
final @NonNull ProxyServer proxyServer,
final @NonNull Function<@NonNull CommandTree<C>, @NonNull CommandExecutionCoordinator<C>> commandExecutionCoordinator,

View file

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

View file

@ -55,6 +55,7 @@ final class VelocityPluginRegistrationHandler<C> implements CommandRegistrationH
}
@Override
@SuppressWarnings("unchecked")
public boolean registerCommand(final @NonNull Command<?> command) {
final CommandArgument<?, ?> argument = command.getArguments().get(0);
final List<String> aliases = ((StaticArgument<C>) argument).getAlternativeAliases();

View file

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

View file

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