Merge branch 'bug3954'

This commit is contained in:
Steffen Schaefer committed 2016-10-25 14:57:24 +02:00
commit 6c03aaa566
1 file changed
+10 -2
@@ -235,7 +235,7 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
// neither do we know about the end time if both, startOfTracking and endOfTracking are null
// and we have neither a valid newestTrackingEvent nor an endOfRace value; if we do, we would
// have to be before the later one plus some leeway.
final Date endTimeOfLivePeriod;
Date endTimeOfLivePeriod;
if (lastRaceTimesInfo.startOfTracking == null && lastRaceTimesInfo.endOfTracking == null) {
Date latestOfNewestTrackingEventAndEndOfRace = lastRaceTimesInfo.newestTrackingEvent;
if (latestOfNewestTrackingEventAndEndOfRace == null || (lastRaceTimesInfo.endOfRace != null && lastRaceTimesInfo.endOfRace.after(latestOfNewestTrackingEventAndEndOfRace))) {
@@ -244,7 +244,15 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
endTimeOfLivePeriod = latestOfNewestTrackingEventAndEndOfRace == null ? null :
new Date(latestOfNewestTrackingEventAndEndOfRace.getTime() + RaceTimesCalculationUtil.TIME_AFTER_LIVE);
} else {
endTimeOfLivePeriod = lastRaceTimesInfo.endOfTracking == null ? null : lastRaceTimesInfo.endOfTracking;
endTimeOfLivePeriod = lastRaceTimesInfo.endOfTracking == null ? null : lastRaceTimesInfo.endOfTracking;
if (lastRaceTimesInfo.endOfRace != null) {
// this is a failsafe, if the tracking was never finsihed, the race was always assumed to be live.
Date latestAllowedTime = new Date(
lastRaceTimesInfo.endOfRace.getTime() + RaceTimesCalculationUtil.MAX_TIME_AFTER_RACE_END);
if (endTimeOfLivePeriod == null || endTimeOfLivePeriod.after(latestAllowedTime)) {
endTimeOfLivePeriod = latestAllowedTime;
}
}
}
isLiveModeToBeMadePossible = endTimeOfLivePeriod == null /* meaning we don't know an end time */ ||
endTimeOfLivePeriod.getTime() >= liveTimePointInMillis;