// Note that it's important to finish all matching, regardless
// of the requested count, because we need to report the total
// number of matches.
for (TaskInProgress tip : allTips) {
ThriftTaskQueryState qstate = null;
if (doFilterStates) {
// Do filter by states
qstate = JTThriftUtils.inferTaskState(tip);
if (!states.contains(qstate))
continue;
}
if (doFilterText) {
// Match against (1) state, (2) most recent state, (3) ID
if (qstate == null)
qstate = JTThriftUtils.inferTaskState(tip);
String qstateStr = qstate.toString();
if (!qstateStr.contains(text) &&
!tip.getTIPId().toString().toUpperCase().contains(text) &&
!tip.generateSingleReport().getState().toUpperCase().contains(text))
continue;
}