From 5376b95763a9a50786f9e36cc33592be46cea0c1 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 8 Sep 2023 09:11:33 -0700 Subject: [PATCH] Flag unused Refaster template parameters Fixes #4060 FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/google/error-prone/pull/4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe50406ce7a5e70d15602468ae99ea7488f0ec5 PiperOrigin-RevId: 563768655 --- .../com/google/errorprone/bugpatterns/UnnecessarilyVisible.java | 2 ++ .../java/com/google/errorprone/bugpatterns/UnusedVariable.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/UnnecessarilyVisible.java b/core/src/main/java/com/google/errorprone/bugpatterns/UnnecessarilyVisible.java index 77a60f328d7..f09be5fe033 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/UnnecessarilyVisible.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/UnnecessarilyVisible.java @@ -56,6 +56,8 @@ public final class UnnecessarilyVisible extends BugChecker implements MethodTree VisitorState.memoize( s -> Stream.of( + "com.google.errorprone.refaster.annotation.AfterTemplate", + "com.google.errorprone.refaster.annotation.BeforeTemplate", "com.google.inject.Inject", "com.google.inject.Provides", "com.google.inject.multibindings.ProvidesIntoMap", diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/UnusedVariable.java b/core/src/main/java/com/google/errorprone/bugpatterns/UnusedVariable.java index 131dd46ca6f..153c4e02971 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/UnusedVariable.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/UnusedVariable.java @@ -150,6 +150,8 @@ public final class UnusedVariable extends BugChecker implements CompilationUnitT // TODO(ghm): Find a sensible place to dedupe this with UnnecessarilyVisible. private static final ImmutableSet ANNOTATIONS_INDICATING_PARAMETERS_SHOULD_BE_CHECKED = ImmutableSet.of( + "com.google.errorprone.refaster.annotation.AfterTemplate", + "com.google.errorprone.refaster.annotation.BeforeTemplate", "com.google.inject.Inject", "com.google.inject.Provides", "com.google.inject.multibindings.ProvidesIntoMap",