Do not flag unused parameters on abstract methods. · google/error-prone@affa37a (original) (raw)

File tree

Original file line number Diff line number Diff line change
@@ -706,7 +706,8 @@ private boolean isParameterSubjectToAnalysis(Symbol sym) {
706 706 checkArgument(sym.getKind() == ElementKind.PARAMETER);
707 707 Symbol enclosingMethod = sym.owner;
708 708
709 -if (!(enclosingMethod instanceof MethodSymbol)) {
709 +if (!(enclosingMethod instanceof MethodSymbol)
710 + |
710 711 return false;
711 712 }
712 713
Original file line number Diff line number Diff line change
@@ -263,6 +263,9 @@ public void unusedParamInPrivateMethod() {
263 263 " System.out.println(i);",
264 264 " }",
265 265 " }",
266 +" private interface Foo {",
267 +" void foo(int a);",
268 +" }",
266 269 " public void main() {",
267 270 " test(1, 2);",
268 271 " }",