diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java index 48659799e1..c0dd31fb76 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java @@ -156,6 +156,7 @@ private static Optional constructMethodRef( return constructFix(lambdaExpr, lhsType.tsym, subTree.getIdentifier()); } + @SuppressWarnings("NestingOptionals") private static Optional> matchArguments( LambdaExpressionTree lambdaExpr, MethodInvocationTree subTree) { ImmutableList expectedArguments = getVariables(lambdaExpr); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java index f84351a1e8..d9395b822d 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/OptionalTemplates.java @@ -311,6 +311,7 @@ Optional after( /** Prefer {@link Optional#or(Supplier)} over more verbose alternatives. */ abstract static class OptionalOrOtherOptional { @BeforeTemplate + @SuppressWarnings("NestingOptionals") Optional before(Optional optional1, Optional optional2) { // XXX: Note that rewriting the first and third variant will change the code's behavior if // `optional2` has side-effects.