From c9607c03cc34707f8229cbece765afb6360ff843 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sat, 17 Aug 2024 14:24:51 +0200 Subject: [PATCH] Also skip RemoveUnusedPrivateMethods when `all` suppressed Fixes https://github.com/openrewrite/rewrite-static-analysis/issues/331 --- .../openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java b/src/main/java/org/openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java index 4b2da88f4..fb7325b86 100644 --- a/src/main/java/org/openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java +++ b/src/main/java/org/openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java @@ -69,7 +69,8 @@ private boolean unusedWarningsSuppressed(J classDeclaration) { List arguments = annotation.getArguments(); if (arguments != null) { for (Expression argument : arguments) { - if (J.Literal.isLiteralValue(argument, "unused")) { + if (J.Literal.isLiteralValue(argument, "all") || + J.Literal.isLiteralValue(argument, "unused")) { return true; } }