From f49790953e6f9c3f9aa88564caf72a3bf002a801 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 13 Oct 2015 13:37:44 +1300 Subject: Fix some more style problems --- src/org/traccar/web/AsyncServlet.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/org/traccar/web') diff --git a/src/org/traccar/web/AsyncServlet.java b/src/org/traccar/web/AsyncServlet.java index d541e29c5..73803ab91 100644 --- a/src/org/traccar/web/AsyncServlet.java +++ b/src/org/traccar/web/AsyncServlet.java @@ -113,8 +113,8 @@ public class AsyncServlet extends BaseServlet { destroyed = true; } Context.getConnectionManager().removeListener(devices, dataListener); - synchronized (asyncSessions) { - asyncSessions.remove(userId); + synchronized (ASYNC_SESSIONS) { + ASYNC_SESSIONS.remove(userId); } } }; @@ -175,17 +175,17 @@ public class AsyncServlet extends BaseServlet { } - private static final Map asyncSessions = new HashMap<>(); + private static final Map ASYNC_SESSIONS = new HashMap<>(); public static void sessionRefreshUser(long userId) { - synchronized (asyncSessions) { - asyncSessions.remove(userId); + synchronized (ASYNC_SESSIONS) { + ASYNC_SESSIONS.remove(userId); } } public static void sessionRefreshDevice(long deviceId) { - synchronized (asyncSessions) { - Iterator> iterator = asyncSessions.entrySet().iterator(); + synchronized (ASYNC_SESSIONS) { + Iterator> iterator = ASYNC_SESSIONS.entrySet().iterator(); while (iterator.hasNext()) { if (iterator.next().getValue().hasDevice(deviceId)) { iterator.remove(); @@ -199,14 +199,14 @@ public class AsyncServlet extends BaseServlet { context.setTimeout(ASYNC_TIMEOUT); HttpServletRequest req = (HttpServletRequest) context.getRequest(); - synchronized (asyncSessions) { + synchronized (ASYNC_SESSIONS) { - if (Boolean.parseBoolean(req.getParameter("first")) || !asyncSessions.containsKey(userId)) { + if (Boolean.parseBoolean(req.getParameter("first")) || !ASYNC_SESSIONS.containsKey(userId)) { Collection devices = Context.getPermissionsManager().allowedDevices(userId); - asyncSessions.put(userId, new AsyncSession(userId, devices)); + ASYNC_SESSIONS.put(userId, new AsyncSession(userId, devices)); } - asyncSessions.get(userId).request(context); + ASYNC_SESSIONS.get(userId).request(context); } } -- cgit v1.2.3