Issue #1638 Added support for null search constraints for updates

Amend: Fixed comment, added SW history

Change-Id: Ie8fb8b308bc77976838c6fa36fba9746cfb0a515

Former-commit-id: 21693d6913 [formerly 1bc4437154] [formerly 807e4501c8 [formerly 9fb8f08aa2068b9249b09ccba555907c40541217]]
Former-commit-id: 807e4501c8
Former-commit-id: 036b11c84e
This commit is contained in:
Max Schenkelberg 2013-05-28 12:24:55 -05:00
parent 50d981285d
commit 6c9fedb312

View file

@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
/**
*
@ -47,6 +48,7 @@ import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
* Jul 3, 2007 chammack Initial Creation.
* Jan 14, 2013 1442 rferrel Added method searchTreeUsingContraints.
* Addition checks on constraints.
* May 28, 2013 1638 mschenke Added proper support for {@link ConstraintType#ISNULL}
*
* </pre>
*
@ -349,14 +351,15 @@ public class DecisionTree<T> {
boolean foundSomething = false;
if (evaluatedConstraint) {
// Evaluate through the values: First search for an exact match
// of non-null values
// Have nodes evaluate against parsedValue, continue if
// searchCriteria does not have entry for this Node's constraint
for (Node n : curNode.nodeChildren) {
RequestConstraint c = n.decision;
if (c == null
|| (c == RequestConstraint.WILDCARD
|| parsedValue == null || c
.evaluate(parsedValue))) {
|| c == RequestConstraint.WILDCARD
|| searchCriteria
.containsKey(curNode.decisionAttribute) == false
|| c.evaluate(parsedValue)) {
foundSomething = true;
searchTree(n, searchCriteria, resultList, lvl + 1,
evaluatedConstraint);