forked from upstream-mirrors/OpenTracks
Cleanup: use Duration.ZERO.
This commit is contained in:
+1
-1
@@ -538,7 +538,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 100, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 100, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
Statistics startStatistics = new Statistics(Instant.parse(startTime), Instant.parse(startTime), Duration.ofSeconds(0), Duration.ofSeconds(0), Distance.ZERO, Speed.ZERO, new AltitudeExtremities(0.0, 0.0), null, null, null);
|
Statistics startStatistics = new Statistics(Instant.parse(startTime), Instant.parse(startTime), Duration.ZERO, Duration.ZERO, Distance.ZERO, Speed.ZERO, new AltitudeExtremities(0.0, 0.0), null, null, null);
|
||||||
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -58,8 +58,8 @@ public class SegmentStatisticUpdaterTest {
|
|||||||
// then
|
// then
|
||||||
assertNull(statistics.getStartTime());
|
assertNull(statistics.getStartTime());
|
||||||
assertNull(statistics.getStopTime());
|
assertNull(statistics.getStopTime());
|
||||||
assertEquals(Duration.ofSeconds(0), statistics.getMovingTime());
|
assertEquals(Duration.ZERO, statistics.getMovingTime());
|
||||||
assertEquals(Duration.ofSeconds(0), statistics.getTotalTime());
|
assertEquals(Duration.ZERO, statistics.getTotalTime());
|
||||||
|
|
||||||
assertNull(statistics.getTotalAltitudeGain());
|
assertNull(statistics.getTotalAltitudeGain());
|
||||||
assertNull(statistics.getTotalAltitudeLoss());
|
assertNull(statistics.getTotalAltitudeLoss());
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public record Speed(double speed_mps) {
|
|||||||
|
|
||||||
public Duration toPace(UnitSystem unitSystem) {
|
public Duration toPace(UnitSystem unitSystem) {
|
||||||
if (isZero()) {
|
if (isZero()) {
|
||||||
return Duration.ofSeconds(0);
|
return Duration.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
double distance = Distance.of(speed_mps).toKM_Miles(unitSystem);
|
double distance = Distance.of(speed_mps).toKM_Miles(unitSystem);
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ public class SegmentStatisticUpdater {
|
|||||||
startTime = null;
|
startTime = null;
|
||||||
stopTime = null;
|
stopTime = null;
|
||||||
|
|
||||||
totalTime = Duration.ofSeconds(0);
|
totalTime = Duration.ZERO;
|
||||||
movingTime = Duration.ofSeconds(0);
|
movingTime = Duration.ZERO;
|
||||||
totalDistance = Distance.ZERO;
|
totalDistance = Distance.ZERO;
|
||||||
maxSpeed = Speed.ZERO;
|
maxSpeed = Speed.ZERO;
|
||||||
totalAltitudeGain_m = null;
|
totalAltitudeGain_m = null;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class IntervalStatisticsUpdater {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
private static class Interval {
|
private static class Interval {
|
||||||
private Distance distance = Distance.ZERO;
|
private Distance distance = Distance.ZERO;
|
||||||
private Duration time = Duration.ofSeconds(0);
|
private Duration time = Duration.ZERO;
|
||||||
private Float gain_m;
|
private Float gain_m;
|
||||||
private Float loss_m;
|
private Float loss_m;
|
||||||
private HeartRate avgHeartRate;
|
private HeartRate avgHeartRate;
|
||||||
|
|||||||
Reference in New Issue
Block a user