From 965126923a36abfff07d4770c68eafca6b253a74 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 10 Nov 2012 11:04:31 +1300 Subject: Fix getDeviceByImei method --- src/org/traccar/model/DatabaseDataManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 list = getDevices(); devices = new HashMap(); - for (Device device: getDevices()) { + for (Device device: list) { devices.put(device.getImei(), device); } devicesLastUpdate = Calendar.getInstance(); -- cgit v1.2.3