mirror of https://github.com/apache/lucene.git
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:
parent
4aafacfbef
commit
247f49c297
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue