Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ggj][ast][engx] fix: validate non-null elements for WhileStatement #469

Merged
merged 18 commits into from
Nov 7, 2020
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0725750
fix: swap assertEquals args in JavaWriterVisitorTest to match (expect…
miraleung Nov 7, 2020
67f3a15
fix: swap assertEquals args in ImportWriterVisitorTest to match (expe…
miraleung Nov 7, 2020
1e1a86b
fix: add node validator to refactor/centralize null element checks
miraleung Nov 7, 2020
115e9fb
fix: validate non-null elements for IfStatement
miraleung Nov 7, 2020
1dac120
fix: validate non-null elements for AnonymousClassExpr
miraleung Nov 7, 2020
004d0f0
fix: validate non-null elements for BlockStatement
miraleung Nov 7, 2020
191e93c
fix: validate non-null elements for ClassDefinition
miraleung Nov 7, 2020
fdb7160
fix: validate non-null elements for ConcreteReference
miraleung Nov 7, 2020
96eca4b
fix: validate non-null elements for ForStatement
miraleung Nov 7, 2020
10924ee
fix: validate non-null elements for GeneralForStatement
miraleung Nov 7, 2020
8493707
fix: validate non-null elements for MethodDefinition
miraleung Nov 7, 2020
a5a572c
fix: validate non-null elements for PackageInfoDefinition
miraleung Nov 7, 2020
e366777
fix: validate non-null elements for SynchronizedStatement
miraleung Nov 7, 2020
ef10eba
fix: validate non-null elements for TryCatchStatement
miraleung Nov 7, 2020
3530735
fix: validate non-null elements for VaporReference
miraleung Nov 7, 2020
1e7beea
fix: validate non-null elements for VariableExpr
miraleung Nov 7, 2020
b901a46
fix: validate non-null elements for WhileStatement
miraleung Nov 7, 2020
9aa3e40
Merge branch 'master' into gp/g16
miraleung Nov 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ public abstract static class Builder {

public abstract Builder setBody(List<Statement> body);

// Private.
abstract ImmutableList<Statement> body();

abstract WhileStatement autoBuild();

public WhileStatement build() {
WhileStatement whileStatement = autoBuild();
NodeValidator.checkNoNullElements(body(), "body", "while statement");
Preconditions.checkState(
whileStatement.conditionExpr().type().equals(TypeNode.BOOLEAN),
"While condition must be a boolean-typed expression");
Expand Down