Skip to content

Commit 018e6b1

Browse files
authored
[ggj][ast][engx] fix: validate non-null elements for GeneralForStatement (#462)
* fix: swap assertEquals args in JavaWriterVisitorTest to match (expected, actusl) order * fix: swap assertEquals args in ImportWriterVisitorTest to match (expected, actusl) order * fix: add node validator to refactor/centralize null element checks * fix: validate non-null elements for IfStatement * fix: validate non-null elements for AnonymousClassExpr * fix: validate non-null elements for BlockStatement * fix: validate non-null elements for ClassDefinition * fix: validate non-null elements for ConcreteReference * fix: validate non-null elements for ForStatement * fix: validate non-null elements for GeneralForStatement
1 parent 24f1231 commit 018e6b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/google/api/generator/engine/ast/GeneralForStatement.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ abstract static class Builder {
7979
// Type-checking will be done in the sub-expressions.
8080
GeneralForStatement build() {
8181
GeneralForStatement generalForStatement = autoBuild();
82+
NodeValidator.checkNoNullElements(
83+
generalForStatement.body(), "body", "general for-statement");
8284
Expr initExpr = generalForStatement.initializationExpr();
8385
if (initExpr instanceof AssignmentExpr) {
8486
VariableExpr localVarExpr = ((AssignmentExpr) initExpr).variableExpr();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy