Source:
public void updateEvent(Event event, Position position) { try { getDataManager().addObject(event); } catch (SQLException error) { LOGGER.warn("Event save error", error); } if (position != null && geocodeOnRequest && Context.getGeocoder() != null && position.getAddress() == null) { position.setAddress(Context.getGeocoder() .getAddress(position.getLatitude(), position.getLongitude(), null)); } long deviceId = event.getDeviceId(); Set<Long> users = Context.getPermissionsManager().getDeviceUsers(deviceId); Set<Long> usersToForward = null; if (Context.getEventForwarder() != null) { usersToForward = new HashSet<>(); } for (long userId : users) { if ((event.getGeofenceId() == 0 || Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) && (event.getMaintenanceId() == 0 || Context.getMaintenancesManager().checkItemPermission(userId, event.getMaintenanceId()))) { if (usersToForward != null) { usersToForward.add(userId); } final Set<String> notificators = new HashSet<>(); for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { boolean filter = false; if (event.getType().equals(Event.TYPE_ALARM)) { String alarmsStr = notification.getString("alarms"); if (alarmsStr != null) { List<String> alarms = Arrays.asList(alarmsStr.split(",")); filter = !alarms.contains(event.getString(Position.KEY_ALARM)); } } if (!filter) { notificators.addAll(notification.getNotificatorsTypes()); } } } for (String notificator : notificators) { Context.getNotificatorManager().getNotificator(notificator).sendAsync(userId, event, position); } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position, usersToForward); } }

Target:
public void updateEvent(Event event, Position position) { try { getDataManager().addObject(event); } catch (SQLException error) { LOGGER.warn("Event save error", error); } if (position != null && geocodeOnRequest && Context.getGeocoder() != null && position.getAddress() == null) { position.setAddress(Context.getGeocoder() .getAddress(position.getLatitude(), position.getLongitude(), null)); } long deviceId = event.getDeviceId(); Set<Long> users = Context.getPermissionsManager().getDeviceUsers(deviceId); Set<Long> usersToForward = null; if (Context.getEventForwarder() != null) { usersToForward = new HashSet<>(); } for (long userId : users) { if ((event.getGeofenceId() == 0 || Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) && (event.getMaintenanceId() == 0 || Context.getMaintenancesManager().checkItemPermission(userId, event.getMaintenanceId()))) { if (usersToForward != null) { usersToForward.add(userId); } final Set<String> notificators = new HashSet<>(); for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { boolean filter = false; if (event.getType().equals(Event.TYPE_ALARM)) { String alarmsAttribute = notification.getString("alarms"); if (alarmsAttribute == null) { filter = true; } else { List<String> alarms = Arrays.asList(alarmsAttribute.split(",")); filter = !alarms.contains(event.getString(Position.KEY_ALARM)); } } if (!filter) { notificators.addAll(notification.getNotificatorsTypes()); } } } for (String notificator : notificators) { Context.getNotificatorManager().getNotificator(notificator).sendAsync(userId, event, position); } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position, usersToForward); } }