Program: 35449
Project: 35449
Buggy source:
public static RoutingRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  RoutingRequest req=new RoutingRequest();
  RouteSearchParameters searchParams=req.getSearchParameters();
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setProfileType(profileType);
  }
 else   throw new MissingParameterException(RoutingErrorCodes.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(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setWeightingMethod(weightingMethod);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    String[] coordValues=value.split("String_Node_Str");
    int nCoords=coordValues.length;
    if (nCoords < 2)     throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str");
    Coordinate[] coords=new Coordinate[nCoords];
    try {
      for (int i=0; i < nCoords; i++) {
        String[] locations=coordValues[i].split("String_Node_Str");
        if (locations.length == 3)         coords[i]=new Coordinate(Double.parseDouble(locations[0]),Double.parseDouble(locations[1]),Integer.parseInt(locations[2]));
 else         coords[i]=new Coordinate(Double.parseDouble(locations[0]),Double.parseDouble(locations[1]));
      }
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    req.setCoordinates(coords);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setUnits(DistanceUnitUtil.getFromString(value,DistanceUnit.Meters));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    if (!LocalizationManager.getInstance().isLanguageSupported(value))     throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str" + value + "String_Node_Str");
    req.setLanguage(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.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);
    req.setGeometryFormat(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setSimplifyGeometry(Boolean.parseBoolean(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setIncludeInstructions(Boolean.parseBoolean(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.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);
    req.setInstructionsFormat(instrFormat);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setExtraInfo(RouteExtraInfoFlag.getFromString(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setAttributes(value.split("String_Node_Str"));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   searchParams.setOptions(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setId(value);
  return req;
}

Fixed version (ground truth):
public static RoutingRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  RoutingRequest req=new RoutingRequest();
  RouteSearchParameters searchParams=req.getSearchParameters();
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setProfileType(profileType);
  }
 else   throw new MissingParameterException(RoutingErrorCodes.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(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    searchParams.setWeightingMethod(weightingMethod);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    String[] coordValues=value.split("String_Node_Str");
    int nCoords=coordValues.length;
    if (nCoords < 2)     throw new StatusCodeException(RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str");
    Coordinate[] coords=new Coordinate[nCoords];
    try {
      for (int i=0; i < nCoords; i++) {
        String[] locations=coordValues[i].split("String_Node_Str");
        if (locations.length == 3)         coords[i]=new Coordinate(Double.parseDouble(locations[0]),Double.parseDouble(locations[1]),Integer.parseInt(locations[2]));
 else         coords[i]=new Coordinate(Double.parseDouble(locations[0]),Double.parseDouble(locations[1]));
      }
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    req.setCoordinates(coords);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setUnits(DistanceUnitUtil.getFromString(value,DistanceUnit.Meters));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    if (!LocalizationManager.getInstance().isLanguageSupported(value))     throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str" + value + "String_Node_Str");
    req.setLanguage(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.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);
    req.setGeometryFormat(value);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setSimplifyGeometry(Boolean.parseBoolean(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setIncludeInstructions(Boolean.parseBoolean(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.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);
    req.setInstructionsFormat(instrFormat);
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setExtraInfo(RouteExtraInfoFlag.getFromString(value));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setAttributes(value.split("String_Node_Str"));
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   searchParams.setOptions(value);
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setId(value);
  return req;
}