private ASTIfStatement findIfStatement(ASTBlock enclosingBlock, Node node) { ASTIfStatement ifStatement = node.getFirstParentOfType(ASTIfStatement.class); List<ASTIfStatement> allIfStatements = enclosingBlock.findDescendantsOfType(ASTIfStatement.class); if (ifStatement != null && allIfStatements.contains(ifStatement)) { return ifStatement; } return null; }
.getFirstChildOfType(ASTBlock.class); List<ASTVariableDeclarator> variableDeclarators = block.findDescendantsOfType(ASTVariableDeclarator.class); for (ASTVariableDeclarator declarator : variableDeclarators) { ASTVariableDeclaratorId variableDeclaratorId = declarator List<ASTAssignmentOperator> assignmentStmts = block.findDescendantsOfType(ASTAssignmentOperator.class); for (ASTAssignmentOperator stmt : assignmentStmts) {
List<ASTName> names = f.findDescendantsOfType(ASTName.class); for (ASTName oName : names) { String name = oName.getImage(); f.findDescendantsOfType(ASTStatementExpression.class, exprs, true); for (ASTStatementExpression stmt : exprs) { ASTPrimaryExpression expr = stmt.getFirstChildOfType(ASTPrimaryExpression.class);
if (block.jjtGetNumChildren() != 1 || block.findDescendantsOfType(ASTStatement.class).size() != 1) { return super.visit(node, data);
private ASTIfStatement findIfStatement(ASTBlock enclosingBlock, Node node) { ASTIfStatement ifStatement = node.getFirstParentOfType(ASTIfStatement.class); List<ASTIfStatement> allIfStatements = enclosingBlock.findDescendantsOfType(ASTIfStatement.class); if (ifStatement != null && allIfStatements.contains(ifStatement)) { return ifStatement; } return null; }
.getFirstChildOfType(ASTBlock.class); List<ASTVariableDeclarator> variableDeclarators = block.findDescendantsOfType(ASTVariableDeclarator.class); for (ASTVariableDeclarator declarator : variableDeclarators) { ASTVariableDeclaratorId variableDeclaratorId = declarator List<ASTAssignmentOperator> assignmentStmts = block.findDescendantsOfType(ASTAssignmentOperator.class); for (ASTAssignmentOperator stmt : assignmentStmts) {
List<ASTName> names = f.findDescendantsOfType(ASTName.class); for (ASTName oName : names) { String name = oName.getImage(); f.findDescendantsOfType(ASTStatementExpression.class, exprs, true); for (ASTStatementExpression stmt : exprs) { ASTPrimaryExpression expr = stmt.getFirstChildOfType(ASTPrimaryExpression.class);
if (block.jjtGetNumChildren() != 1 || block.findDescendantsOfType(ASTStatement.class).size() != 1) { return super.visit(node, data);