aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-05-24 15:17:38 -0700
committerAnton Tananaev <anton@traccar.org>2023-05-24 15:17:47 -0700
commit11bbfb69360937c361b701065cdbc2e90699693e (patch)
tree32eec713827c3082408dc862cf8e08dbde8afb6b /src/main/java/org/traccar
parent8f1e0431b0a782aa4551c05bbfc4493c77845d58 (diff)
downloadtrackermap-server-11bbfb69360937c361b701065cdbc2e90699693e.tar.gz
trackermap-server-11bbfb69360937c361b701065cdbc2e90699693e.tar.bz2
trackermap-server-11bbfb69360937c361b701065cdbc2e90699693e.zip
Remove duplicated list
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/reports/common/ReportUtils.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/reports/common/ReportUtils.java b/src/main/java/org/traccar/reports/common/ReportUtils.java
index f5aa6d040..cd52b5de4 100644
--- a/src/main/java/org/traccar/reports/common/ReportUtils.java
+++ b/src/main/java/org/traccar/reports/common/ReportUtils.java
@@ -162,7 +162,7 @@ public class ReportUtils {
}
private TripReportItem calculateTrip(
- Device device, ArrayList<Position> positions, int startIndex, int endIndex,
+ Device device, List<Position> positions, int startIndex, int endIndex,
boolean ignoreOdometer) throws StorageException {
Position startTrip = positions.get(startIndex);
@@ -228,7 +228,7 @@ public class ReportUtils {
}
private StopReportItem calculateStop(
- Device device, ArrayList<Position> positions, int startIndex, int endIndex, boolean ignoreOdometer) {
+ Device device, List<Position> positions, int startIndex, int endIndex, boolean ignoreOdometer) {
Position startStop = positions.get(startIndex);
Position endStop = positions.get(endIndex);
@@ -275,7 +275,7 @@ public class ReportUtils {
@SuppressWarnings("unchecked")
private <T extends BaseReportItem> T calculateTripOrStop(
- Device device, ArrayList<Position> positions, int startIndex, int endIndex,
+ Device device, List<Position> positions, int startIndex, int endIndex,
boolean ignoreOdometer, Class<T> reportClass) throws StorageException {
if (reportClass.equals(TripReportItem.class)) {
@@ -285,7 +285,7 @@ public class ReportUtils {
}
}
- private boolean isMoving(ArrayList<Position> positions, int index, TripsConfig tripsConfig) {
+ private boolean isMoving(List<Position> positions, int index, TripsConfig tripsConfig) {
if (tripsConfig.getMinimalNoDataDuration() > 0) {
boolean beforeGap = index < positions.size() - 1
&& positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime()
@@ -301,14 +301,13 @@ public class ReportUtils {
}
public <T extends BaseReportItem> Collection<T> detectTripsAndStops(
- Device device, Collection<Position> positionCollection, boolean ignoreOdometer,
+ Device device, List<Position> positions, boolean ignoreOdometer,
Class<T> reportClass) throws StorageException {
Collection<T> result = new ArrayList<>();
TripsConfig tripsConfig = new TripsConfig(
new AttributeUtil.StorageProvider(config, storage, permissionsService, device));
- ArrayList<Position> positions = new ArrayList<>(positionCollection);
if (!positions.isEmpty()) {
boolean trips = reportClass.equals(TripReportItem.class);