Fix Conjunction.addOperator to do nothing if term is empty

prevent to result in query string with repeated logical operator
like "field:term AND AND field:term"
possibliy causing out of mem in postprocessing_doublecontent
This commit is contained in:
reger 2017-08-14 00:52:03 +02:00
parent b6a41df4f7
commit d03e2c98ea

View File

@ -19,10 +19,17 @@ public abstract class AbstractOperations extends AbstractTerm implements Operati
for (Term t: this.terms) h += t.hashCode();
return h;
}
/**
* Add the term with the defined logical operator.
* If length of term is empty nothing is changed
* @param term
*/
@Override
public void addOperand(Term term) {
this.terms.add(term);
if (term.toString().isEmpty()) {
this.terms.add(term);
}
}
/**