LUCENE-6570: Make BooleanQuery.Builder.add(Query,Occur) return this, like other methods.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1686150 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2015-06-18 08:44:58 +00:00
parent 4aafacfbef
commit 247f49c297
1 changed files with 2 additions and 1 deletions

View File

@ -118,12 +118,13 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
/**
* @throws TooManyClauses if the new number of clauses exceeds the maximum clause number
*/
public void add(Query query, Occur occur) {
public Builder add(Query query, Occur occur) {
if (clauses.size() >= maxClauseCount) {
throw new TooManyClauses();
}
query = query.clone(); // be defensive
clauses.add(new BooleanClause(query, occur));
return this;
}
/** Create a new {@link BooleanQuery} based on the parameters that have