From 781f4b0a01dd8b16892b0bb907d43f9e0ca6f2ba Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 12 Jul 2016 09:55:13 +1200 Subject: Use long primitive type --- src/org/traccar/database/GeofenceManager.java | 8 ++++---- src/org/traccar/database/NotificationManager.java | 2 +- src/org/traccar/events/GeofenceEventHandler.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java index 32c9e2368..c35e19e9a 100644 --- a/src/org/traccar/database/GeofenceManager.java +++ b/src/org/traccar/database/GeofenceManager.java @@ -192,7 +192,7 @@ public class GeofenceManager { } Position lastPosition = Context.getConnectionManager().getLastPosition(device.getId()); if (lastPosition != null && deviceGeofencesWithGroups.containsKey(device.getId())) { - for (Long geofenceId : deviceGeofencesWithGroups.get(device.getId())) { + for (long geofenceId : deviceGeofencesWithGroups.get(device.getId())) { Geofence geofence = getGeofence(geofenceId); if (geofence != null && geofence.getGeometry() .containsPoint(lastPosition.getLatitude(), lastPosition.getLongitude())) { @@ -236,7 +236,7 @@ public class GeofenceManager { geofencesLock.readLock().lock(); try { Collection result = new LinkedList<>(); - for (Long geofenceId : geofencesIds) { + for (long geofenceId : geofencesIds) { result.add(getGeofence(geofenceId)); } return result; @@ -245,7 +245,7 @@ public class GeofenceManager { } } - public final Geofence getGeofence(Long geofenceId) { + public final Geofence getGeofence(long geofenceId) { geofencesLock.readLock().lock(); try { return geofences.get(geofenceId); @@ -274,7 +274,7 @@ public class GeofenceManager { public List getCurrentDeviceGeofences(Position position) { List result = new ArrayList<>(); - for (Long geofenceId : getAllDeviceGeofences(position.getDeviceId())) { + for (long geofenceId : getAllDeviceGeofences(position.getDeviceId())) { if (getGeofence(geofenceId).getGeometry().containsPoint(position.getLatitude(), position.getLongitude())) { result.add(geofenceId); } diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index d263e160f..e618d7ed3 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -54,7 +54,7 @@ public class NotificationManager { } Set users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId()); - for (Long userId : users) { + for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { Notification notification = getUserNotificationByType(userId, event.getType()); diff --git a/src/org/traccar/events/GeofenceEventHandler.java b/src/org/traccar/events/GeofenceEventHandler.java index a3d8aa375..9a546182d 100644 --- a/src/org/traccar/events/GeofenceEventHandler.java +++ b/src/org/traccar/events/GeofenceEventHandler.java @@ -66,7 +66,7 @@ public class GeofenceEventHandler extends BaseEventHandler { try { if (dataManager.getLastEvents(position.getDeviceId(), Event.TYPE_GEOFENCE_ENTER, suppressRepeated).isEmpty()) { - for (Long geofenceId : newGeofences) { + for (long geofenceId : newGeofences) { Event event = new Event(Event.TYPE_GEOFENCE_ENTER, position.getDeviceId(), position.getId()); event.setGeofenceId(geofenceId); events.add(event); @@ -78,7 +78,7 @@ public class GeofenceEventHandler extends BaseEventHandler { try { if (dataManager.getLastEvents(position.getDeviceId(), Event.TYPE_GEOFENCE_EXIT, suppressRepeated).isEmpty()) { - for (Long geofenceId : oldGeofences) { + for (long geofenceId : oldGeofences) { Event event = new Event(Event.TYPE_GEOFENCE_EXIT, position.getDeviceId(), position.getId()); event.setGeofenceId(geofenceId); events.add(event); -- cgit v1.2.3