From 26911407f621e174638dde1276261a7161d08fa9 Mon Sep 17 00:00:00 2001 From: Vincent Koeman Date: Wed, 17 Aug 2022 15:20:09 +0200 Subject: [PATCH] Suppress new (self-check) warning in two spots --- .../tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java | 1 + .../picnic/errorprone/refastertemplates/OptionalTemplates.java | 1 + 2 files changed, 2 insertions(+) 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.