Skip to content

Commit

Permalink
Readability for anonymous variables in java language module
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoOfTwelve committed Nov 28, 2023
1 parent 93e9a71 commit c5956b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import com.sun.source.util.TreeScanner;

final class TokenGeneratingTreeScanner extends TreeScanner<Void, Void> {
private final static String ANONYMOUS_VARIABLE_NAME = "";

private final File file;
private final Parser parser;
private final LineMap map;
Expand Down Expand Up @@ -460,7 +462,7 @@ public Void visitAssert(AssertTree node, Void unused) {

@Override
public Void visitVariable(VariableTree node, Void unused) {
if (!node.getName().contentEquals("")) {
if (!node.getName().contentEquals(ANONYMOUS_VARIABLE_NAME)) {
long start = positions.getStartPosition(ast, node);
String name = node.getName().toString();
boolean inLocalScope = variableRegistry.inLocalScope();
Expand Down

0 comments on commit c5956b3

Please sign in to comment.