From 9dab86cd9f5f4ff556343717e322686684e9a1b5 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 48659799e15..c0dd31fb761 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 f84351a1e8f..d9395b822d3 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.