diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-08-03 20:52:00 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-08-03 20:52:00 -0600 |
commit | 55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch) | |
tree | b86bed801b0bbadb72c7e839296dae1d28b12bbb /src/main/java/org/traccar/session/cache/CacheManager.java | |
parent | c04ad7d48331253c095fc123ded1b00f6ff871d3 (diff) | |
parent | 2788174193def918a3a1a5be3bbed24c9613323f (diff) | |
download | trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.gz trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.bz2 trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.zip |
Merge tag 'tags/v6.3'
Diffstat (limited to 'src/main/java/org/traccar/session/cache/CacheManager.java')
-rw-r--r-- | src/main/java/org/traccar/session/cache/CacheManager.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java index 064e5672f..39546a5a7 100644 --- a/src/main/java/org/traccar/session/cache/CacheManager.java +++ b/src/main/java/org/traccar/session/cache/CacheManager.java @@ -170,7 +170,7 @@ public class CacheManager implements BroadcastInterface { public void removeDevice(long deviceId) { try { lock.writeLock().lock(); - if (deviceReferences.computeIfAbsent(deviceId, k -> new AtomicInteger()).incrementAndGet() <= 0) { + if (deviceReferences.computeIfAbsent(deviceId, k -> new AtomicInteger()).decrementAndGet() <= 0) { graph.removeObject(Device.class, deviceId); devicePositions.remove(deviceId); deviceReferences.remove(deviceId); @@ -296,8 +296,8 @@ public class CacheManager implements BroadcastInterface { } } } else { - if (object instanceof GroupedModel) { - long groupId = ((GroupedModel) object).getGroupId(); + if (object instanceof GroupedModel groupedModel) { + long groupId = groupedModel.getGroupId(); if (groupId > 0) { invalidatePermission(object.getClass(), object.getId(), Group.class, groupId, true); } @@ -319,8 +319,8 @@ public class CacheManager implements BroadcastInterface { } } - if (object instanceof Schedulable) { - long calendarId = ((Schedulable) object).getCalendarId(); + if (object instanceof Schedulable schedulable) { + long calendarId = schedulable.getCalendarId(); if (calendarId > 0) { invalidatePermission(object.getClass(), object.getId(), Calendar.class, calendarId, true); } |