Skip to content

Commit

Permalink
Simpler solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jun 17, 2023
1 parent 7c1c99b commit 28a9d48
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import com.google.errorprone.suppliers.Supplier;
import com.google.errorprone.util.ASTHelpers;
import com.sun.source.tree.MethodTree;
import com.sun.source.tree.Tree;
import com.sun.source.tree.Tree.Kind;
import com.sun.source.tree.VariableTree;
import com.sun.tools.javac.code.Symbol;
Expand Down Expand Up @@ -147,8 +146,7 @@ public Description matchVariable(VariableTree tree, VisitorState state) {
String name = tree.getName().toString();
if (symbol.owner instanceof MethodSymbol
&& symbol.getKind() == ElementKind.PARAMETER
&& ASTHelpers.findEnclosingNode(state.getPath(), Tree.class).getKind()
!= Kind.LAMBDA_EXPRESSION) {
&& state.getPath().getParentPath().getLeaf().getKind() != Kind.LAMBDA_EXPRESSION) {
var methodSymbol = (MethodSymbol) symbol.owner;
int index = methodSymbol.getParameters().indexOf(symbol);
var maybeSuper = ASTHelpers.streamSuperMethods(methodSymbol, state.getTypes()).findFirst();
Expand Down

0 comments on commit 28a9d48

Please sign in to comment.