forked from upstream-mirrors/OpenTracks
Cleanup using AndroidStudio's code analyzer.
This commit is contained in:
@@ -130,7 +130,7 @@ public class GpxTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
||||
trackImporter.newTrack();
|
||||
break;
|
||||
case TAG_TRACK_SEGMENT:
|
||||
onTrackSegmentStart();
|
||||
//Nothing to do here.
|
||||
break;
|
||||
case TAG_TRACK_POINT:
|
||||
onTrackPointStart(attributes);
|
||||
@@ -236,9 +236,6 @@ public class GpxTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
||||
content = "";
|
||||
}
|
||||
|
||||
private void onTrackSegmentStart() {
|
||||
}
|
||||
|
||||
private void onTrackSegmentEnd() {
|
||||
if (currentSegment.isEmpty()) {
|
||||
Log.w(TAG, "No locations in current segment.");
|
||||
|
||||
@@ -4,10 +4,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
public class ParsingException extends RuntimeException {
|
||||
|
||||
private ParsingException(@NonNull String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
protected ParsingException(@NonNull String message, Exception cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -140,17 +139,14 @@ public class TrackImporter {
|
||||
track.setUuid(UUID.randomUUID());
|
||||
}
|
||||
|
||||
Collections.sort(trackPoints, new Comparator<TrackPoint>() {
|
||||
@Override
|
||||
public int compare(TrackPoint o1, TrackPoint o2) {
|
||||
if (o1.getTime().isBefore(o2.getTime())) {
|
||||
return -1;
|
||||
}
|
||||
if (o1.getTime().isAfter(o2.getTime())) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
Collections.sort(trackPoints, (o1, o2) -> {
|
||||
if (o1.getTime().isBefore(o2.getTime())) {
|
||||
return -1;
|
||||
}
|
||||
if (o1.getTime().isAfter(o2.getTime())) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
TrackStatisticsUpdater updater = new TrackStatisticsUpdater();
|
||||
|
||||
Reference in New Issue
Block a user