diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-25 08:23:23 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-25 08:23:23 +0500 |
commit | f35961c2f4a3104a009d6e3cd6bc862e6810b998 (patch) | |
tree | d5a8462060a0c5bb4bcc53e1de19d0b0b3b37bcc /src/org | |
parent | 870a919f53986724c023bcde9d0eddf8888e9007 (diff) | |
download | trackermap-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.tar.gz trackermap-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.tar.bz2 trackermap-server-f35961c2f4a3104a009d6e3cd6bc862e6810b998.zip |
Use function for removing
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/database/SimpleObjectManager.java | 10 |
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) { |