Program: 35446
Project: 35446
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)) {
    Coordinate[] coords=null;
    try {
      coords=CoordTools.parse(value,"String_Node_Str",true,false);
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    if (coords.length < 2)     throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_VALUE,"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)) {
    try {
      searchParams.setOptions(value);
    }
 catch (    Exception ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str");
    }
  }
  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)) {
    Coordinate[] coords=null;
    try {
      coords=CoordTools.parse(value,"String_Node_Str",true,false);
    }
 catch (    NumberFormatException ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
    }
    if (coords.length < 2)     throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_PARAMETER_VALUE,"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)) {
    try {
      searchParams.setOptions(value);
    }
 catch (    Exception ex) {
      throw new StatusCodeException(StatusCode.BAD_REQUEST,RoutingErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str" + ex.getMessage());
    }
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value))   req.setId(value);
  return req;
}