Skip to content

Commit

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

* 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

* fix: validate non-null elements for TryCatchStatement
  • Loading branch information
miraleung authored Nov 7, 2020
1 parent df14ba8 commit a1ee8f8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public abstract static class Builder {

public TryCatchStatement build() {
TryCatchStatement tryCatchStatement = autoBuild();
NodeValidator.checkNoNullElements(tryCatchStatement.tryBody(), "try body", "try-catch");
NodeValidator.checkNoNullElements(tryCatchStatement.catchBody(), "catch body", "try-catch");

if (!tryCatchStatement.isSampleCode()) {
Preconditions.checkNotNull(
tryCatchStatement.catchVariableExpr(),
Expand Down

0 comments on commit a1ee8f8

Please sign in to comment.