Source:
public static Location getLocation(String id, FormEntryContext context) { Location location = null; if (id != null) { id = id.trim(); if (id.startsWith("GlobalProperty:")) { String gpName = id.substring("GlobalProperty:".length()); String gpValue = Context.getAdministrationService().getGlobalProperty(gpName); if (StringUtils.isNotEmpty(gpValue)) { return getLocation(gpValue, context); } } if (id.startsWith("UserProperty:")) { String upName = id.substring("UserProperty:".length()); String upValue = Context.getAuthenticatedUser().getUserProperty(upName); if (StringUtils.isNotEmpty(upValue)) { return getLocation(upValue, context); } } if (id.startsWith("SessionAttribute:")) { if (context.getHttpSession() == null) { return null; } String saName = id.substring("SessionAttribute:".length()); Object saValue = context.getHttpSession().getAttribute(saName); if (saValue == null) { return null; } else if (saValue instanceof Location) { return (Location) saValue; } else if (saValue instanceof String) { return getLocation((String) saValue, context); } else { return getLocation(saValue.toString(), context); } } try { int locationId = Integer.parseInt(id); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { } if (isValidUuidFormat(id)) { location = Context.getLocationService().getLocationByUuid(id); if (location != null) { return location; } } location = Context.getLocationService().getLocation(id); if (location != null) { return location; } if(id.contains("SYSTEM_DEFAULT")) { location= Context.getLocationService().getDefaultLocation(); if(location!=null) { return location; } } if (id.contains(" ")) { String[] values = id.split(" "); try { int locationId = Integer.parseInt(values[0]); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { ex.printStackTrace(); } } } return null; }

Target:
public static Location getLocation(String id, FormEntryContext context) { Location location = null; if (id != null) { id = id.trim(); if (id.startsWith("GlobalProperty:")) { String gpName = id.substring("GlobalProperty:".length()); String gpValue = Context.getAdministrationService().getGlobalProperty(gpName); if (StringUtils.isNotEmpty(gpValue)) { return getLocation(gpValue, context); } } if (id.startsWith("UserProperty:")) { String upName = id.substring("UserProperty:".length()); String upValue = Context.getAuthenticatedUser().getUserProperty(upName); if (StringUtils.isNotEmpty(upValue)) { return getLocation(upValue, context); } } if (id.startsWith("SessionAttribute:")) { if (context.getHttpSession() == null) { return null; } String saName = id.substring("SessionAttribute:".length()); Object saValue = context.getHttpSession().getAttribute(saName); if (saValue == null) { return null; } else if (saValue instanceof Location) { return (Location) saValue; } else if (saValue instanceof String) { return getLocation((String) saValue, context); } else { return getLocation(saValue.toString(), context); } } try { int locationId = Integer.parseInt(id); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { } if (isValidUuidFormat(id)) { location = Context.getLocationService().getLocationByUuid(id); if (location != null) { return location; } } location = Context.getLocationService().getLocation(id); if (location != null) { return location; } if(id.contains(HtmlFormEntryConstants.GP_DEAFULT_LOCATION)) { location= Context.getLocationService().getDefaultLocation(); if(location!=null) { return location; } } if (id.contains(" ")) { String[] values = id.split(" "); try { int locationId = Integer.parseInt(values[0]); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { ex.printStackTrace(); } } } return null; }