Skip to content

Commit

Permalink
[ggj][ast][engx] fix: validate non-null elements for ForStatement (#461)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
miraleung authored Nov 7, 2020
1 parent ca05b80 commit 24f1231
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public abstract static class Builder {

public ForStatement build() {
ForStatement forStatement = autoBuild();
NodeValidator.checkNoNullElements(forStatement.body(), "body", "for-statement");
Preconditions.checkState(
forStatement.localVariableExpr().isDecl(),
"For-statement variable must be a declaration");
Expand Down

0 comments on commit 24f1231

Please sign in to comment.