Source:
<code>public <R extends PhotonRequest> R create(Request webRequest) throws BadRequestException { for(String queryParam: webRequest.queryParams()) if(!m_hsRequestQueryParams.contains(queryParam)) throw new BadRequestException(400, "unknown query parameter '" + queryParam + "'. Allowed parameters are: " + m_hsRequestQueryParams); String language = webRequest.queryParams("lang"); language = language == null ? "en" : language; languageChecker.apply(language); String query = webRequest.queryParams("q"); if (query == null) throw new BadRequestException(400, "missing search term 'q': /?q=berlin"); Integer limit; try { limit = Integer.valueOf(webRequest.queryParams("limit")); } catch (NumberFormatException e) { limit = 15; } Point locationForBias = null; try { Double lon = Double.valueOf(webRequest.queryParams("lon")); Double lat = Double.valueOf(webRequest.queryParams("lat")); locationForBias = geometryFactory.createPoint(new Coordinate(lon, lat)); } catch (Exception nfe) { } Boolean locationDistanceSort = true; try { if(webRequest.queryParams("distanceSort") == null) locationDistanceSort = true; else <START> locationDistanceSort = Boolean.valueOf(webRequest.queryParams("distanceSort")); <END> } catch (Exception nfe) { } QueryParamsMap tagFiltersQueryMap = webRequest.queryMap("osm_tag"); if (!new CheckIfFilteredRequest().execute(tagFiltersQueryMap)) { return (R) new PhotonRequest(query, limit, locationForBias, locationDistanceSort, language); } FilteredPhotonRequest photonRequest = new FilteredPhotonRequest(query, limit, locationForBias, locationDistanceSort, language); String[] tagFilters = tagFiltersQueryMap.values(); setUpTagFilters(photonRequest, tagFilters); return (R) photonRequest; }</code><technical_language>under_score format for parameter IMO</technical_language>

Target:
public <R extends PhotonRequest> R create(Request webRequest) throws BadRequestException { for(String queryParam: webRequest.queryParams()) if(!m_hsRequestQueryParams.contains(queryParam)) throw new BadRequestException(400, "unknown query parameter '" + queryParam + "'. Allowed parameters are: " + m_hsRequestQueryParams); String language = webRequest.queryParams("lang"); language = language == null ? "en" : language; languageChecker.apply(language); String query = webRequest.queryParams("q"); if (query == null) throw new BadRequestException(400, "missing search term 'q': /?q=berlin"); Integer limit; try { limit = Integer.valueOf(webRequest.queryParams("limit")); } catch (NumberFormatException e) { limit = 15; } Point locationForBias = null; try { Double lon = Double.valueOf(webRequest.queryParams("lon")); Double lat = Double.valueOf(webRequest.queryParams("lat")); locationForBias = geometryFactory.createPoint(new Coordinate(lon, lat)); } catch (Exception nfe) { } Boolean locationDistanceSort = true; try { if(webRequest.queryParams("distance_sort") == null) locationDistanceSort = true; else locationDistanceSort = Boolean.valueOf(webRequest.queryParams("distance_sort")); } catch (Exception nfe) { } QueryParamsMap tagFiltersQueryMap = webRequest.queryMap("osm_tag"); if (!new CheckIfFilteredRequest().execute(tagFiltersQueryMap)) { return (R) new PhotonRequest(query, limit, locationForBias, locationDistanceSort, language); } FilteredPhotonRequest photonRequest = new FilteredPhotonRequest(query, limit, locationForBias, locationDistanceSort, language); String[] tagFilters = tagFiltersQueryMap.values(); setUpTagFilters(photonRequest, tagFilters); return (R) photonRequest; }