aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-25 08:23:23 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-25 08:23:23 +0500
commitf35961c2f4a3104a009d6e3cd6bc862e6810b998 (patch)
treed5a8462060a0c5bb4bcc53e1de19d0b0b3b37bcc
parent870a919f53986724c023bcde9d0eddf8888e9007 (diff)
downloadtraccar-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.tar.gz
traccar-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.tar.bz2
traccar-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.zip
Use function for removing
-rw-r--r--src/org/traccar/database/SimpleObjectManager.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/database/SimpleObjectManager.java b/src/org/traccar/database/SimpleObjectManager.java
index 6cb7ff260..282dea46e 100644
--- a/src/org/traccar/database/SimpleObjectManager.java
+++ b/src/org/traccar/database/SimpleObjectManager.java
@@ -67,10 +67,6 @@ public abstract class SimpleObjectManager {
items.clear();
}
- protected void removeCachedItem(long itemId) {
- items.remove(itemId);
- }
-
public final Set<Long> getUserItems(long userId) {
if (!userItems.containsKey(userId)) {
userItems.put(userId, new HashSet<Long>());
@@ -104,7 +100,7 @@ public abstract class SimpleObjectManager {
}
for (Long cachedItemId : items.keySet()) {
if (!databaseItemIds.contains(cachedItemId)) {
- items.remove(cachedItemId);
+ removeCachedItem(cachedItemId);
}
}
} catch (SQLException error) {
@@ -145,6 +141,10 @@ public abstract class SimpleObjectManager {
updateCachedItem(item);
}
+ protected void removeCachedItem(long itemId) {
+ items.remove(itemId);
+ }
+
public void removeItem(long itemId) throws SQLException {
BaseModel item = getById(itemId);
if (item != null) {