Issue #1442 Fix null pointer exception in DecisonTree's searchTree
Change-Id: I5bf36da8aa6e8ef2a2efee08e01e232bff8eb7ef Former-commit-id:07a103c3bb
[formerly152715160e
] [formerly09b5996dac
[formerly 9ef63af71325c5b6694f41c78506d618078e0b9e]] Former-commit-id:09b5996dac
Former-commit-id:fd95a99596
This commit is contained in:
parent
a1df296e80
commit
186c71e5ac
1 changed files with 3 additions and 13 deletions
|
@ -46,6 +46,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.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -356,12 +357,7 @@ public class DecisionTree<T> {
|
|||
|| (c == RequestConstraint.WILDCARD
|
||||
|| parsedValue == null || c
|
||||
.evaluate(parsedValue))) {
|
||||
// for (int k = 0; k < lvl; k++) {
|
||||
// System.out.print(" ");
|
||||
// }
|
||||
foundSomething = true;
|
||||
// System.out.println("visit: " + curNode.decisionAttribute
|
||||
// + ":: " + c);
|
||||
searchTree(n, searchCriteria, resultList, lvl + 1,
|
||||
evaluatedConstraint);
|
||||
}
|
||||
|
@ -370,13 +366,9 @@ public class DecisionTree<T> {
|
|||
// Evaluate using existing constraints.
|
||||
for (Node n : curNode.nodeChildren) {
|
||||
RequestConstraint c = n.decision;
|
||||
if (parsedValue.equals(c)) {
|
||||
// for (int k = 0; k < lvl; k++) {
|
||||
// System.out.print(" ");
|
||||
// }
|
||||
if ((c == null && parsedValue == null)
|
||||
|| (parsedValue != null && parsedValue.equals(c))) {
|
||||
foundSomething = true;
|
||||
// System.out.println("visit: " + curNode.decisionAttribute
|
||||
// + ":: " + c);
|
||||
searchTree(n, searchCriteria, resultList, lvl + 1,
|
||||
evaluatedConstraint);
|
||||
}
|
||||
|
@ -521,8 +513,6 @@ public class DecisionTree<T> {
|
|||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
dataMap.put("pluginName", "grib");
|
||||
dataMap.put("model", "nam12");
|
||||
// List<Integer> list = iDT.searchTree(dataMap);
|
||||
// System.out.println(list.get(0));
|
||||
|
||||
Map<String, Object> dataMap2 = new HashMap<String, Object>();
|
||||
dataMap2.put("pluginName", "grib");
|
||||
|
|
Loading…
Add table
Reference in a new issue