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);
|
||||
|
||||
// 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());
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -58,8 +58,8 @@ public class SegmentStatisticUpdaterTest {
|
||||
// then
|
||||
assertNull(statistics.getStartTime());
|
||||
assertNull(statistics.getStopTime());
|
||||
assertEquals(Duration.ofSeconds(0), statistics.getMovingTime());
|
||||
assertEquals(Duration.ofSeconds(0), statistics.getTotalTime());
|
||||
assertEquals(Duration.ZERO, statistics.getMovingTime());
|
||||
assertEquals(Duration.ZERO, statistics.getTotalTime());
|
||||
|
||||
assertNull(statistics.getTotalAltitudeGain());
|
||||
assertNull(statistics.getTotalAltitudeLoss());
|
||||
|
||||
@@ -82,7 +82,7 @@ public record Speed(double speed_mps) {
|
||||
|
||||
public Duration toPace(UnitSystem unitSystem) {
|
||||
if (isZero()) {
|
||||
return Duration.ofSeconds(0);
|
||||
return Duration.ZERO;
|
||||
}
|
||||
|
||||
double distance = Distance.of(speed_mps).toKM_Miles(unitSystem);
|
||||
|
||||
@@ -185,8 +185,8 @@ public class SegmentStatisticUpdater {
|
||||
startTime = null;
|
||||
stopTime = null;
|
||||
|
||||
totalTime = Duration.ofSeconds(0);
|
||||
movingTime = Duration.ofSeconds(0);
|
||||
totalTime = Duration.ZERO;
|
||||
movingTime = Duration.ZERO;
|
||||
totalDistance = Distance.ZERO;
|
||||
maxSpeed = Speed.ZERO;
|
||||
totalAltitudeGain_m = null;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class IntervalStatisticsUpdater {
|
||||
@Deprecated
|
||||
private static class Interval {
|
||||
private Distance distance = Distance.ZERO;
|
||||
private Duration time = Duration.ofSeconds(0);
|
||||
private Duration time = Duration.ZERO;
|
||||
private Float gain_m;
|
||||
private Float loss_m;
|
||||
private HeartRate avgHeartRate;
|
||||
|
||||
Reference in New Issue
Block a user