Skip to content

Commit

Permalink
HSEARCH-3885 Pass the inner predicate to the nested predicate builder…
Browse files Browse the repository at this point in the history
… immediately

... instead of delaying until the call to toImplementation().
Because:

1. We no longer need this delay, like we did when the DSL was more
   complicated.
2. Removing this delay allows us to throw exceptions in the nested()
   method if the given predicate is not compatible with the nested
   predicate, leading to a clearer stacktrace for users.
  • Loading branch information
yrodiere committed Apr 8, 2020
1 parent 2a4fbaa commit bf57ef2
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -51,6 +51,7 @@ public NestedPredicateOptionsStep<?> nest(SearchPredicate searchPredicate) {
throw log.cannotAddMultiplePredicatesToNestedPredicate();
}
this.childPredicateBuilder = builderFactory.toImplementation( searchPredicate );
builder.nested( childPredicateBuilder );
return this;
}

Expand All @@ -62,7 +63,6 @@ public NestedPredicateOptionsStep<?> nest(

@Override
protected B toImplementation() {
builder.nested( childPredicateBuilder );
return builder.toImplementation();
}

Expand Down

0 comments on commit bf57ef2

Please sign in to comment.