Issue #2249 availableTime now always return non-empty list.

Change-Id: Id0afee6e7673ff0eb062dc2deebacd89fece78ec

Former-commit-id: b12987b714 [formerly dc846b2f2c] [formerly 4528b03c70 [formerly d29c0635c08e75cb956cf415ffcdfacd53c53fd8]]
Former-commit-id: 4528b03c70
Former-commit-id: 4c61794a6f
This commit is contained in:
Roger Ferrel 2013-10-25 11:16:22 -05:00
parent 6aab62b7b9
commit 550138a28a

View file

@ -20,8 +20,8 @@ import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
@ -40,6 +40,7 @@ import com.raytheon.viz.core.mode.CAVEMode;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* May 3, 2011 jsanchez Initial creation * May 3, 2011 jsanchez Initial creation
* Oct 25, 2013 2249 rferrel getAvailableTimes always returns a non-empty list.
* *
* </pre> * </pre>
* *
@ -143,11 +144,19 @@ public class WWAResourceData extends AbstractRequestableResourceData {
&& phenSig.getConstraintValue().contains(".A") ? getWatchStartTimes(warnings) && phenSig.getConstraintValue().contains(".A") ? getWatchStartTimes(warnings)
: getWarningStartTimes(warnings); : getWarningStartTimes(warnings);
if (SimulatedTime.getSystemTime().isRealTime()) { // DR2249
// Add the current time to the end of the array. // When not in real time the commented code allows availableTimes to be
startTimes // empty. This causes Null pointer exceptions when getting frames. If
.add(new DataTime(SimulatedTime.getSystemTime().getTime())); // always placing non-realtime causes other problems may want to add
} // only when startTimes is empty:
// if (SimulatedTime.getSystemTime().isRealTime()) {
// // Add the current time to the end of the array.
// startTimes.add(new
// DataTime(SimulatedTime.getSystemTime().getTime()));
// }
// Add current configured system time.
startTimes.add(new DataTime(TimeUtil.newDate()));
DataTime[] availableTimes = startTimes.toArray(new DataTime[startTimes DataTime[] availableTimes = startTimes.toArray(new DataTime[startTimes
.size()]); .size()]);