Merge "Issue #1480 guarantee that framesInfo returned from descriptor is always valid." into development
Former-commit-id:a3a7dc44c9
[formerly 2069b8265416fae4c8fbeb37b4686b85428eca7f] Former-commit-id:7009876544
This commit is contained in:
commit
c3dec53498
2 changed files with 10 additions and 1 deletions
|
@ -604,6 +604,15 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
int idx = frameIndex;
|
int idx = frameIndex;
|
||||||
if (frames != null) {
|
if (frames != null) {
|
||||||
frames = Arrays.copyOf(frames, frames.length);
|
frames = Arrays.copyOf(frames, frames.length);
|
||||||
|
if (idx < 0 || idx >= frames.length) {
|
||||||
|
// This only happens for 4-panels with shared time managers.
|
||||||
|
idx = frames.length - 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// It should already be -1 already but this is here for
|
||||||
|
// certain 4 panels where the time manager is shared and the
|
||||||
|
// index and frames are out of sync.
|
||||||
|
idx = -1;
|
||||||
}
|
}
|
||||||
Map<AbstractVizResource<?, ?>, DataTime[]> timeMap = new HashMap<AbstractVizResource<?, ?>, DataTime[]>(
|
Map<AbstractVizResource<?, ?>, DataTime[]> timeMap = new HashMap<AbstractVizResource<?, ?>, DataTime[]>(
|
||||||
timeMatchingMap);
|
timeMatchingMap);
|
||||||
|
|
|
@ -304,7 +304,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
// Next try to get the closest time to
|
// Next try to get the closest time to
|
||||||
DataTime[] origSteps = currInfo.getFrameTimes();
|
DataTime[] origSteps = currInfo.getFrameTimes();
|
||||||
int curIndex = currInfo.getFrameIndex();
|
int curIndex = currInfo.getFrameIndex();
|
||||||
if (origSteps != null && curIndex > 0 && curIndex < origSteps.length) {
|
if (origSteps != null && curIndex >= 0 && curIndex < origSteps.length) {
|
||||||
DataTime startTime = origSteps[curIndex];
|
DataTime startTime = origSteps[curIndex];
|
||||||
int dateIndex = Arrays.binarySearch(timeSteps, startTime);
|
int dateIndex = Arrays.binarySearch(timeSteps, startTime);
|
||||||
if (dateIndex < 0) {
|
if (dateIndex < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue