From 2aee053266bfe52a322cd4be98fef17c83691240 Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Fri, 25 Oct 2013 11:16:22 -0500 Subject: [PATCH] Issue #2249 availableTime now always return non-empty list. Change-Id: Id0afee6e7673ff0eb062dc2deebacd89fece78ec Former-commit-id: dea388b7746018ee167a3775d43c4d5c7a441c95 [formerly b12987b714ae15775e250222bb8610f9c71f1fb0] [formerly dc846b2f2c236bf1c13467576620c5aad94bdfd1] [formerly dea388b7746018ee167a3775d43c4d5c7a441c95 [formerly b12987b714ae15775e250222bb8610f9c71f1fb0] [formerly dc846b2f2c236bf1c13467576620c5aad94bdfd1] [formerly 4528b03c702d899e321419d221e0675f9f6db253 [formerly dc846b2f2c236bf1c13467576620c5aad94bdfd1 [formerly d29c0635c08e75cb956cf415ffcdfacd53c53fd8]]]] Former-commit-id: 4528b03c702d899e321419d221e0675f9f6db253 Former-commit-id: a8366bfc312325386647f6d58b93de7c2b63f607 [formerly 550138a28a36ada4bdf2a2cb5d346d595b6c0451] [formerly 74b3ee81ce861235a91c4cc2dce5d557570f65b1 [formerly 4c61794a6fc217c11e85f16d7537f3ed477dc1b2]] Former-commit-id: e595e11f21ed6b3ecf9e8178b1c5ff31f8bc162a [formerly 3a5f91793db4c777d6db4bae5fed59ecce38e376] Former-commit-id: dfdf7e6df36954f34f495eb3c0c7ca52b7bed966 --- .../viz/warnings/rsc/WWAResourceData.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java index 36d956dc14..76c3d33e99 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java @@ -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.time.BinOffset; 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.util.TimeUtil; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; @@ -40,6 +40,7 @@ import com.raytheon.viz.core.mode.CAVEMode; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 3, 2011 jsanchez Initial creation + * Oct 25, 2013 2249 rferrel getAvailableTimes always returns a non-empty list. * * * @@ -143,11 +144,19 @@ public class WWAResourceData extends AbstractRequestableResourceData { && phenSig.getConstraintValue().contains(".A") ? getWatchStartTimes(warnings) : getWarningStartTimes(warnings); - if (SimulatedTime.getSystemTime().isRealTime()) { - // Add the current time to the end of the array. - startTimes - .add(new DataTime(SimulatedTime.getSystemTime().getTime())); - } + // DR2249 + // When not in real time the commented code allows availableTimes to be + // empty. This causes Null pointer exceptions when getting frames. If + // 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 .size()]);