diff --git a/src/main/java/com/google/api/generator/engine/ast/SynchronizedStatement.java b/src/main/java/com/google/api/generator/engine/ast/SynchronizedStatement.java index 41a94ef351..5bd58d8d13 100644 --- a/src/main/java/com/google/api/generator/engine/ast/SynchronizedStatement.java +++ b/src/main/java/com/google/api/generator/engine/ast/SynchronizedStatement.java @@ -60,6 +60,14 @@ public Builder setBody(Statement... statements) { // Private. abstract Builder setLock(Expr expr); - public abstract SynchronizedStatement build(); + abstract ImmutableList body(); + + abstract SynchronizedStatement autoBuild(); + + public SynchronizedStatement build() { + NodeValidator.checkNoNullElements(body(), "body statements", "synchronized statement"); + + return autoBuild(); + } } }