Program: 35444
Project: 35444
Buggy source:
public static AccessibilityRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  AccessibilityRequest req=new AccessibilityRequest();
  Coordinate[] locations=null;
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setId(value);
  LocationsRequest reqLocations=req.getLocationsRequest();
  reqLocations.setType(LocationRequestType.POIS);
  LocationsSearchFilter query=reqLocations.getSearchFilter();
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setCategoryGroupIds(JsonUtility.parseIntArray(value,"String_Node_Str"));
 else {
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     query.setCategoryIds(JsonUtility.parseIntArray(value,"String_Node_Str"));
  }
  if (query.getCategoryGroupIds() == null && query.getCategoryIds() == null)   throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setName(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setWheelchair(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setSmoking(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setFee(parseBooleanFlag(value));
  reqLocations.setLanguage(request.getParameter("String_Node_Str"));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    String[] coords=value.split("String_Node_Str");
    if (coords == null || coords.length != 4)     throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    Envelope bbox=null;
    try {
      bbox=new Envelope(Double.parseDouble(coords[0]),Double.parseDouble(coords[2]),Double.parseDouble(coords[1]),Double.parseDouble(coords[3]));
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    reqLocations.setBBox(bbox);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int ivalue=Integer.parseInt(value);
    if (AccessibilityServiceSettings.getResponseLimit() > 0 && AccessibilityServiceSettings.getResponseLimit() < ivalue)     throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",value,Integer.toString(AccessibilityServiceSettings.getResponseLimit()));
    req.setLimit(ivalue);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    LocationsResultSortType sortType=LocationsResultSortType.fromString(value);
    if (sortType == LocationsResultSortType.NONE)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    reqLocations.setSortType(sortType);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int detailsType=LocationDetailsType.fromString(value);
    if (detailsType == LocationDetailsType.NONE)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    reqLocations.setDetails(detailsType);
  }
  RoutingRequest reqRouting=req.getRoutingRequest();
  RouteSearchParameters searchParams=reqRouting.getSearchParameters();
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setProfileType(profileType);
  }
 else   throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int weightingMethod=WeightingMethod.getFromString(value);
    if (weightingMethod == WeightingMethod.UNKNOWN)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setWeightingMethod(weightingMethod);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   reqRouting.setUnits(DistanceUnitUtil.getFromString(value,DistanceUnit.Meters));
  if (AccessibilityServiceSettings.getRouteDetailsAllowed()) {
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      if (!LocalizationManager.getInstance().isLanguageSupported(value))       throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str" + value + "String_Node_Str");
      reqRouting.setLanguage(value);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeGeometry(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      if (!("String_Node_Str".equalsIgnoreCase(value) || "String_Node_Str".equalsIgnoreCase(value) || "String_Node_Str".equalsIgnoreCase(value)))       throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
      reqRouting.setGeometryFormat(value);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setSimplifyGeometry(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeInstructions(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeElevation(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      RouteInstructionsFormat instrFormat=RouteInstructionsFormat.fromString(value);
      if (instrFormat == RouteInstructionsFormat.UNKNOWN)       throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
      reqRouting.setInstructionsFormat(instrFormat);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setExtraInfo(RouteExtraInfoFlag.getFromString(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setAttributes(value.split("String_Node_Str"));
    req.setRoutesFormat(request.getParameter("String_Node_Str"));
  }
 else {
    reqRouting.setIncludeGeometry(false);
    reqRouting.setIncludeInstructions(false);
    req.setRoutesFormat("String_Node_Str");
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    try {
      searchParams.setOptions(value);
    }
 catch (    Exception ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str");
    }
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    try {
      locations=CoordTools.parse(value,"String_Node_Str",false,false);
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    if (AccessibilityServiceSettings.getMaximumLocations() > 0 && locations.length > AccessibilityServiceSettings.getMaximumLocations())     throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",Integer.toString(locations.length),Integer.toString(AccessibilityServiceSettings.getMaximumLocations()));
    req.setLocations(locations);
  }
 else {
    throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    if (!"String_Node_Str".equalsIgnoreCase(value) && !"String_Node_Str".equalsIgnoreCase(value))     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    req.setLocationType(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
switch (value.toLowerCase()) {
case "String_Node_Str":
      req.setRangeType(TravelRangeType.Distance);
    break;
case "String_Node_Str":
  req.setRangeType(TravelRangeType.Time);
break;
default :
throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
req.setRange(Double.parseDouble(value));
if (req.getRange() > AccessibilityServiceSettings.getMaximumRange(req.getRangeType())) throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",Integer.toString(AccessibilityServiceSettings.getMaximumRange(req.getRangeType())),Double.toString(req.getRange()));
}
 else throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
return req;
}

Fixed version (ground truth):
public static AccessibilityRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  AccessibilityRequest req=new AccessibilityRequest();
  Coordinate[] locations=null;
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setId(value);
  LocationsRequest reqLocations=req.getLocationsRequest();
  reqLocations.setType(LocationRequestType.POIS);
  LocationsSearchFilter query=reqLocations.getSearchFilter();
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setCategoryGroupIds(JsonUtility.parseIntArray(value,"String_Node_Str"));
 else {
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     query.setCategoryIds(JsonUtility.parseIntArray(value,"String_Node_Str"));
  }
  if (query.getCategoryGroupIds() == null && query.getCategoryIds() == null)   throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setName(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setWheelchair(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setSmoking(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   query.setFee(parseBooleanFlag(value));
  reqLocations.setLanguage(request.getParameter("String_Node_Str"));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    String[] coords=value.split("String_Node_Str");
    if (coords == null || coords.length != 4)     throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    Envelope bbox=null;
    try {
      bbox=new Envelope(Double.parseDouble(coords[0]),Double.parseDouble(coords[2]),Double.parseDouble(coords[1]),Double.parseDouble(coords[3]));
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    reqLocations.setBBox(bbox);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int ivalue=Integer.parseInt(value);
    if (AccessibilityServiceSettings.getResponseLimit() > 0 && AccessibilityServiceSettings.getResponseLimit() < ivalue)     throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",value,Integer.toString(AccessibilityServiceSettings.getResponseLimit()));
    req.setLimit(ivalue);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    LocationsResultSortType sortType=LocationsResultSortType.fromString(value);
    if (sortType == LocationsResultSortType.NONE)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    reqLocations.setSortType(sortType);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int detailsType=LocationDetailsType.fromString(value);
    if (detailsType == LocationDetailsType.NONE)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    reqLocations.setDetails(detailsType);
  }
  RoutingRequest reqRouting=req.getRoutingRequest();
  RouteSearchParameters searchParams=reqRouting.getSearchParameters();
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setProfileType(profileType);
  }
 else   throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int weightingMethod=WeightingMethod.getFromString(value);
    if (weightingMethod == WeightingMethod.UNKNOWN)     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setWeightingMethod(weightingMethod);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   reqRouting.setUnits(DistanceUnitUtil.getFromString(value,DistanceUnit.Meters));
  if (AccessibilityServiceSettings.getRouteDetailsAllowed()) {
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      if (!LocalizationManager.getInstance().isLanguageSupported(value))       throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str" + value + "String_Node_Str");
      reqRouting.setLanguage(value);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeGeometry(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      if (!("String_Node_Str".equalsIgnoreCase(value) || "String_Node_Str".equalsIgnoreCase(value) || "String_Node_Str".equalsIgnoreCase(value)))       throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
      reqRouting.setGeometryFormat(value);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setSimplifyGeometry(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeInstructions(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setIncludeElevation(Boolean.parseBoolean(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      RouteInstructionsFormat instrFormat=RouteInstructionsFormat.fromString(value);
      if (instrFormat == RouteInstructionsFormat.UNKNOWN)       throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
      reqRouting.setInstructionsFormat(instrFormat);
    }
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setExtraInfo(RouteExtraInfoFlag.getFromString(value));
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value))     reqRouting.setAttributes(value.split("String_Node_Str"));
    req.setRoutesFormat(request.getParameter("String_Node_Str"));
  }
 else {
    reqRouting.setIncludeGeometry(false);
    reqRouting.setIncludeInstructions(false);
    req.setRoutesFormat("String_Node_Str");
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    try {
      searchParams.setOptions(value);
    }
 catch (    Exception ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str" + ex.getMessage());
    }
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    try {
      locations=CoordTools.parse(value,"String_Node_Str",false,false);
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,AccessibilityErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    if (AccessibilityServiceSettings.getMaximumLocations() > 0 && locations.length > AccessibilityServiceSettings.getMaximumLocations())     throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",Integer.toString(locations.length),Integer.toString(AccessibilityServiceSettings.getMaximumLocations()));
    req.setLocations(locations);
  }
 else {
    throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    if (!"String_Node_Str".equalsIgnoreCase(value) && !"String_Node_Str".equalsIgnoreCase(value))     throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    req.setLocationType(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
switch (value.toLowerCase()) {
case "String_Node_Str":
      req.setRangeType(TravelRangeType.Distance);
    break;
case "String_Node_Str":
  req.setRangeType(TravelRangeType.Time);
break;
default :
throw new UnknownParameterValueException(AccessibilityErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
req.setRange(Double.parseDouble(value));
if (req.getRange() > AccessibilityServiceSettings.getMaximumRange(req.getRangeType())) throw new ParameterOutOfRangeException(AccessibilityErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM,"String_Node_Str",Integer.toString(AccessibilityServiceSettings.getMaximumRange(req.getRangeType())),Double.toString(req.getRange()));
}
 else throw new MissingParameterException(AccessibilityErrorCodes.MISSING_PARAMETER,"String_Node_Str");
return req;
}