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

@ -52,6 +52,7 @@ class AnnotatedMethodService<Context, Result> implements Service<Context, Result
executionOrder = order.value();
}
} catch (final Exception ignored) {
// This is fine
}
this.instance = instance;
this.executionOrder = executionOrder;

View file

@ -32,6 +32,8 @@ import org.checkerframework.checker.nullness.qual.NonNull;
*/
public final class PipelineException extends RuntimeException {
private static final long serialVersionUID = -7092487758537841656L;
/**
* Construct a new pipeline exception
*

View file

@ -108,7 +108,7 @@ public final class ServicePipeline {
* @return Service pipeline instance
* @throws Exception Any exceptions thrown during the registration process
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
public <T> @NonNull ServicePipeline registerMethods(
final @NonNull T instance
) throws Exception {

View file

@ -50,6 +50,7 @@ public interface ConsumerService<Context>
}
@Override
@SuppressWarnings("FunctionalInterfaceMethodChanged")
default @NonNull State handle(final @NonNull Context context) {
try {
this.accept(context);
@ -71,6 +72,8 @@ public interface ConsumerService<Context>
class PipeBurst extends RuntimeException {
private static final long serialVersionUID = -1143137258194595985L;
private PipeBurst() {
}

View file

@ -55,6 +55,7 @@ public interface Service<Context, Result> extends Function<@NonNull Context, @Nu
@Nullable Result handle(@NonNull Context context) throws Exception;
@Override
@SuppressWarnings("FunctionalInterfaceMethodChanged")
default @Nullable Result apply(@NonNull Context context) {
try {
return this.handle(context);