Skip to content

Commit

Permalink
minor: removes extra method call from UnusedLocalVariableCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and romani committed Apr 29, 2024
1 parent 55f5c96 commit c932f53
Showing 1 changed file with 9 additions and 11 deletions.
Expand Up @@ -232,8 +232,8 @@ else if (type == TokenTypes.IDENT) {
else if (isInsideLocalAnonInnerClass(ast)) {
visitLocalAnonInnerClass(ast);
}
else if (TokenUtil.isTypeDeclaration(type)) {
visitTypeDeclarationToken(ast);
else if (isNonLocalTypeDeclaration(ast)) {
visitNonLocalTypeDeclarationToken(ast);
}
else if (type == TokenTypes.PACKAGE_DEF) {
packageName = CheckUtil.extractQualifiedName(ast.getFirstChild().getNextSibling());
Expand Down Expand Up @@ -304,18 +304,16 @@ private static void visitIdentToken(DetailAST identAst, Deque<VariableDesc> vari
}

/**
* Visit the type declaration token.
* Visit the non-local type declaration token.
*
* @param typeDeclAst type declaration ast
*/
private void visitTypeDeclarationToken(DetailAST typeDeclAst) {
if (isNonLocalTypeDeclaration(typeDeclAst)) {
final String qualifiedName = getQualifiedTypeDeclarationName(typeDeclAst);
final TypeDeclDesc currTypeDecl = new TypeDeclDesc(qualifiedName, depth, typeDeclAst);
depth++;
typeDeclarations.push(currTypeDecl);
typeDeclAstToTypeDeclDesc.put(typeDeclAst, currTypeDecl);
}
private void visitNonLocalTypeDeclarationToken(DetailAST typeDeclAst) {
final String qualifiedName = getQualifiedTypeDeclarationName(typeDeclAst);
final TypeDeclDesc currTypeDecl = new TypeDeclDesc(qualifiedName, depth, typeDeclAst);
depth++;
typeDeclarations.push(currTypeDecl);
typeDeclAstToTypeDeclDesc.put(typeDeclAst, currTypeDecl);
}

/**
Expand Down

0 comments on commit c932f53

Please sign in to comment.