forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -20,10 +20,6 @@ public record Distance(double distance_m) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated //TODO Remove
|
|
||||||
public static Distance of(String distance_m) {
|
|
||||||
return of(Float.parseFloat(distance_m));
|
|
||||||
}
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Distance ofOrNull(Double distance_m) {
|
public static Distance ofOrNull(Double distance_m) {
|
||||||
if (distance_m == null) {
|
if (distance_m == null) {
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ public class GPXTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
|||||||
}
|
}
|
||||||
if (accuracyHorizontal != null) {
|
if (accuracyHorizontal != null) {
|
||||||
try {
|
try {
|
||||||
accuracyHorizontalParsed = Distance.of(accuracyHorizontal);
|
accuracyHorizontalParsed = Distance.of(Float.parseFloat(accuracyHorizontal));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse accuracy_horizontal: %s", sensorDistance)), e);
|
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse accuracy_horizontal: %s", sensorDistance)), e);
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@ public class GPXTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
|||||||
}
|
}
|
||||||
if (accuracyVertical != null) {
|
if (accuracyVertical != null) {
|
||||||
try {
|
try {
|
||||||
accuracyVerticalParsed = Distance.of(accuracyVertical);
|
accuracyVerticalParsed = Distance.of(Float.parseFloat(accuracyVertical));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse accuracy_vertical: %s", accuracyVertical)), e);
|
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse accuracy_vertical: %s", accuracyVertical)), e);
|
||||||
}
|
}
|
||||||
@@ -378,7 +378,7 @@ public class GPXTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
|||||||
}
|
}
|
||||||
if (sensorDistance != null) {
|
if (sensorDistance != null) {
|
||||||
try {
|
try {
|
||||||
trackPoint.setSensorDistance(Distance.of(sensorDistance));
|
trackPoint.setSensorDistance(Distance.of(Float.parseFloat(sensorDistance)));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse distance: %s", sensorDistance)), e);
|
throw new ParsingException(createErrorMessage(String.format(Locale.US, "Unable to parse distance: %s", sensorDistance)), e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user