aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-11-10 11:04:31 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2012-11-10 11:04:31 +1300
commit965126923a36abfff07d4770c68eafca6b253a74 (patch)
tree57b95f602a1a23a3ca75cf1bac5b10c5b804e94f /src/org/traccar
parent022ecd5d0b97528b5d14c61b684a08aba0f03456 (diff)
downloadtraccar-server-965126923a36abfff07d4770c68eafca6b253a74.tar.gz
traccar-server-965126923a36abfff07d4770c68eafca6b253a74.tar.bz2
traccar-server-965126923a36abfff07d4770c68eafca6b253a74.zip
Fix getDeviceByImei method
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/model/DatabaseDataManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index 7521828a3..f17839594 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -171,8 +171,9 @@ public class DatabaseDataManager implements DataManager {
public Device getDeviceByImei(String imei) throws SQLException {
if ((devices == null) || (Calendar.getInstance().getTimeInMillis() - devicesLastUpdate.getTimeInMillis() > devicesRefreshDelay)) {
+ List<Device> list = getDevices();
devices = new HashMap<String, Device>();
- for (Device device: getDevices()) {
+ for (Device device: list) {
devices.put(device.getImei(), device);
}
devicesLastUpdate = Calendar.getInstance();