From f35961c2f4a3104a009d6e3cd6bc862e6810b998 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 25 Jul 2017 08:23:23 +0500 Subject: Use function for removing --- src/org/traccar/database/SimpleObjectManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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 getUserItems(long userId) { if (!userItems.containsKey(userId)) { userItems.put(userId, new HashSet()); @@ -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) { -- cgit v1.2.3