Skip to content

Commit

Permalink
[ggj][ast][engx] fix: validate non-null elements for SynchronizedStat…
Browse files Browse the repository at this point in the history
…ement (#465)

* 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

* fix: validate non-null elements for MethodDefinition

* fix: validate non-null elements for PackageInfoDefinition

* fix: validate non-null elements for SynchronizedStatement
  • Loading branch information
miraleung authored Nov 7, 2020
1 parent 97caddc commit df14ba8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public Builder setBody(Statement... statements) {
// Private.
abstract Builder setLock(Expr expr);

public abstract SynchronizedStatement build();
abstract ImmutableList<Statement> body();

abstract SynchronizedStatement autoBuild();

public SynchronizedStatement build() {
NodeValidator.checkNoNullElements(body(), "body statements", "synchronized statement");

return autoBuild();
}
}
}

0 comments on commit df14ba8

Please sign in to comment.