✨ Add errorprone and fix warnings/errors
The compiler will also treat all warnings as errors from now on.
This commit is contained in:
parent
6ffee9d04f
commit
cfac2639ad
101 changed files with 309 additions and 146 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue