From 6f265ddb8bcbe225b90f83d1d276b3fc65aee09b Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Tue, 28 May 2024 07:37:34 -0700 Subject: [PATCH] Add a disabled regression test for an UnusedVariable bug https://github.com/google/error-prone/issues/4409 PiperOrigin-RevId: 637894916 --- .../bugpatterns/UnusedVariableTest.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java index 815127a5220..d86028c149f 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/UnusedVariableTest.java @@ -1655,4 +1655,29 @@ public void unusedFunctionalInterfaceParameter_noFix() { .expectUnchanged() .doTest(); } + + @Ignore("https://github.com/google/error-prone/issues/4409") + @Test + public void parameterUsedInOverride() { + refactoringHelper + .addInputLines( + "App.java", + "public class App {", + " private static class Base {", + " protected void doStuff(String usedInDescendants) {}", + " }", + " private static class Descendant extends Base {", + " @Override", + " protected void doStuff(String actuallyUsed) {", + " System.out.println(actuallyUsed);", + " }", + " }", + " public static void main(String[] args) {", + " Base b = new Descendant();", + " b.doStuff(\"some string\");", + " }", + "}") + .expectUnchanged() + .doTest(); + } }