aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DriversManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-02 16:58:00 +1200
committerGitHub <noreply@github.com>2017-08-02 16:58:00 +1200
commitd44c9c778773bd036e46303676652a0d408e7d8c (patch)
treeb9ea003eb2a68dce0faa4d7173516e456e7906fe /src/org/traccar/database/DriversManager.java
parent237c80296fe947c6857c9509ba1b947ed02b354f (diff)
parent75374d646e3fe848e00eb7b959b557c0ed0ade68 (diff)
downloadtrackermap-server-d44c9c778773bd036e46303676652a0d408e7d8c.tar.gz
trackermap-server-d44c9c778773bd036e46303676652a0d408e7d8c.tar.bz2
trackermap-server-d44c9c778773bd036e46303676652a0d408e7d8c.zip
Merge pull request #3406 from Abyss777/fix_unknown_uniqueid
Fix retrieving objects by unknown tokens/uniqueId
Diffstat (limited to 'src/org/traccar/database/DriversManager.java')
-rw-r--r--src/org/traccar/database/DriversManager.java6
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);
}
}