diff options
author | Abyss777 <abyss@fox5.ru> | 2017-08-01 17:23:24 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-08-01 17:31:15 +0500 |
commit | 75374d646e3fe848e00eb7b959b557c0ed0ade68 (patch) | |
tree | b14f9faebdee0e30a8ace2102939b23413ee2967 /src/org/traccar/database/DriversManager.java | |
parent | e400191c041b33284743b2303ab72721e831a0a3 (diff) | |
download | trackermap-server-75374d646e3fe848e00eb7b959b557c0ed0ade68.tar.gz trackermap-server-75374d646e3fe848e00eb7b959b557c0ed0ade68.tar.bz2 trackermap-server-75374d646e3fe848e00eb7b959b557c0ed0ade68.zip |
Fix retrieving objects by unknown tokens/uniqueId
Diffstat (limited to 'src/org/traccar/database/DriversManager.java')
-rw-r--r-- | src/org/traccar/database/DriversManager.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/database/DriversManager.java b/src/org/traccar/database/DriversManager.java index 9defa1931..930951460 100644 --- a/src/org/traccar/database/DriversManager.java +++ b/src/org/traccar/database/DriversManager.java @@ -23,7 +23,7 @@ import org.traccar.model.Driver; public class DriversManager extends ExtendedObjectManager<Driver> { - private Map<String, Long> driversByUniqueId; + private Map<String, Driver> driversByUniqueId; public DriversManager(DataManager dataManager) { super(dataManager, Driver.class); @@ -36,7 +36,7 @@ public class DriversManager extends ExtendedObjectManager<Driver> { if (driversByUniqueId == null) { driversByUniqueId = new ConcurrentHashMap<>(getAllItems().size()); } - driversByUniqueId.put(driver.getUniqueId(), driver.getId()); + driversByUniqueId.put(driver.getUniqueId(), driver); } @Override @@ -68,6 +68,6 @@ public class DriversManager extends ExtendedObjectManager<Driver> { } public Driver getDriverByUniqueId(String uniqueId) { - return getById(driversByUniqueId.get(uniqueId)); + return driversByUniqueId.get(uniqueId); } } |