Source:
<code>public void updateEvent(Event event, Position position) { try { getDataManager().addObject(event); } catch (SQLException error) { Log.warning(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() != null && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) <START> && (event.getMaintenanceId() == 0 <END> || Context.getMaintenancesManager().checkItemPermission(userId, event.getMaintenanceId()))) { if (usersToForward != null) { usersToForward.add(userId); } boolean sentWeb = false; boolean sentMail = false; boolean sentSms = Context.getSmppManager() == null; for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { if (!sentWeb && notification.getWeb()) { Context.getConnectionManager().updateEvent(userId, event); sentWeb = true; } if (!sentMail && notification.getMail()) { NotificationMail.sendMailAsync(userId, event, position); sentMail = true; } if (!sentSms && notification.getSms()) { NotificationSms.sendSmsAsync(userId, event, position); sentSms = true; } } if (sentWeb && sentMail && sentSms) { break; } } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position, usersToForward); } }</code><technical_language>Do need check if manager is null? If not, remove geofence manager check</technical_language>

Target:
public void updateEvent(Event event, Position position) { try { getDataManager().addObject(event); } catch (SQLException error) { Log.warning(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); } boolean sentWeb = false; boolean sentMail = false; boolean sentSms = Context.getSmppManager() == null; for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { if (!sentWeb && notification.getWeb()) { Context.getConnectionManager().updateEvent(userId, event); sentWeb = true; } if (!sentMail && notification.getMail()) { NotificationMail.sendMailAsync(userId, event, position); sentMail = true; } if (!sentSms && notification.getSms()) { NotificationSms.sendSmsAsync(userId, event, position); sentSms = true; } } if (sentWeb && sentMail && sentSms) { break; } } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position, usersToForward); } }