From d03e2c98ea6bd5701c8e8257174c439b9c006afb Mon Sep 17 00:00:00 2001 From: reger Date: Mon, 14 Aug 2017 00:52:03 +0200 Subject: [PATCH] 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 --- .../cora/federate/solr/logic/AbstractOperations.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/cora/federate/solr/logic/AbstractOperations.java b/source/net/yacy/cora/federate/solr/logic/AbstractOperations.java index a1c4a8270..12d0c7af9 100644 --- a/source/net/yacy/cora/federate/solr/logic/AbstractOperations.java +++ b/source/net/yacy/cora/federate/solr/logic/AbstractOperations.java @@ -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); + } } /**