Program: 35442
Project: 35442
Buggy source:
public static IsochroneRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  IsochroneRequest req=new IsochroneRequest();
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    req.getRouteSearchParameters().setProfileType(profileType);
  }
 else {
    throw new MissingParameterException(IsochronesErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  }
  double rangeValue=-1;
  value=request.getParameter("String_Node_Str");
  if (Helper.isEmpty(value))   throw new MissingParameterException(IsochronesErrorCodes.MISSING_PARAMETER,"String_Node_Str");
 else {
    String[] rangeValues=value.split("String_Node_Str");
    if (rangeValues.length == 1) {
      try {
        rangeValue=Double.parseDouble(value);
      }
 catch (      NumberFormatException ex) {
        throw new StatusCodeException(StatusCode.BAD_REQUEST,IsochronesErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
      }
    }
 else {
      double[] ranges=new double[rangeValues.length];
      double maxRange=Double.MIN_VALUE;
      for (int i=0; i < ranges.length; i++) {
        double dv=Double.parseDouble(rangeValues[i]);
        if (dv > maxRange)         maxRange=dv;
        ranges[i]=dv;
      }
      Arrays.sort(ranges);
      req.setRanges(ranges);
      req.setMaximumRange(maxRange);
    }
  }
  value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    if (rangeValue != -1)     req.setRanges(rangeValue,Double.parseDouble(value));
  }
 else {
    req.setRanges(new double[]{rangeValue});
  }
  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(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
if (req.getRangeType() == TravelRangeType.Distance) {
if (!("String_Node_Str".equals(value) || "String_Node_Str".equals(value) || "String_Node_Str".equals(value))) throw new UnknownParameterValueException("String_Node_Str",value);
}
 else {
throw new StatusCodeException(StatusCode.BAD_REQUEST,IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str");
}
req.setUnits(value.toLowerCase());
}
boolean inverseXY=false;
value=request.getParameter("String_Node_Str");
if (Helper.isEmpty(value)) {
value=request.getParameter("String_Node_Str");
inverseXY=true;
}
if (!Helper.isEmpty(value)) {
Coordinate[] coords=null;
try {
coords=CoordTools.parse(value,"String_Node_Str",false,inverseXY);
}
 catch (NumberFormatException nfex) {
throw new StatusCodeException(StatusCode.BAD_REQUEST,IsochronesErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str" + nfex.getMessage());
}
catch (Exception ex) {
throw new StatusCodeException(StatusCode.BAD_REQUEST,IsochronesErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str" + ex.getMessage());
}
req.setLocations(coords);
}
 else {
throw new MissingParameterException(IsochronesErrorCodes.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("String_Node_Str",value);
req.setLocationType(value);
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) req.setCalcMethod(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)) req.setIncludeIntersections(Boolean.parseBoolean(value));
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
try {
req.getRouteSearchParameters().setOptions(value);
}
 catch (Exception ex) {
throw new StatusCodeException(StatusCode.BAD_REQUEST,IsochronesErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str" + ex.getMessage());
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) req.setId(value);
return req;
}

Fixed version (ground truth):
public static IsochroneRequest parseFromRequestParams(HttpServletRequest request) throws Exception {
  IsochroneRequest req=new IsochroneRequest();
  String value=request.getParameter("String_Node_Str");
  if (!Helper.isEmpty(value)) {
    int profileType=RoutingProfileType.getFromString(value);
    if (profileType == RoutingProfileType.UNKNOWN)     throw new UnknownParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
    req.getRouteSearchParameters().setProfileType(profileType);
  }
 else {
    throw new MissingParameterException(IsochronesErrorCodes.MISSING_PARAMETER,"String_Node_Str");
  }
  double rangeValue=-1.0;
  boolean skipInterval=false;
  value=request.getParameter("String_Node_Str");
  if (Helper.isEmpty(value))   throw new MissingParameterException(IsochronesErrorCodes.MISSING_PARAMETER,"String_Node_Str");
 else {
    String[] rangeValues=value.split("String_Node_Str");
    if (rangeValues.length == 1) {
      try {
        rangeValue=Double.parseDouble(value);
        req.setRanges(new double[]{rangeValue});
        req.setMaximumRange(rangeValue);
      }
 catch (      NumberFormatException ex) {
        throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
      }
    }
 else {
      double[] ranges=new double[rangeValues.length];
      double maxRange=Double.MIN_VALUE;
      for (int i=0; i < ranges.length; i++) {
        double dv=Double.parseDouble(rangeValues[i]);
        if (dv > maxRange)         maxRange=dv;
        ranges[i]=dv;
      }
      Arrays.sort(ranges);
      req.setRanges(ranges);
      req.setMaximumRange(maxRange);
      skipInterval=true;
    }
  }
  if (!skipInterval) {
    value=request.getParameter("String_Node_Str");
    if (!Helper.isEmpty(value)) {
      if (rangeValue != -1) {
        req.setRanges(rangeValue,Double.parseDouble(value));
        req.setMaximumRange(rangeValue);
      }
    }
  }
  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(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
if (req.getRangeType() == TravelRangeType.Distance) {
if (!("String_Node_Str".equals(value) || "String_Node_Str".equals(value) || "String_Node_Str".equals(value))) throw new UnknownParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
}
 else {
throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str");
}
req.setUnits(value.toLowerCase());
}
boolean inverseXY=false;
value=request.getParameter("String_Node_Str");
if (Helper.isEmpty(value)) {
value=request.getParameter("String_Node_Str");
inverseXY=true;
}
if (!Helper.isEmpty(value)) {
Coordinate[] coords=null;
try {
coords=CoordTools.parse(value,"String_Node_Str",false,inverseXY);
}
 catch (NumberFormatException nfex) {
throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_FORMAT,"String_Node_Str");
}
req.setLocations(coords);
}
 else {
throw new MissingParameterException(IsochronesErrorCodes.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(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",value);
req.setLocationType(value);
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) req.setCalcMethod(value);
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
String[] values=value.split("String_Node_Str");
for (int i=0; i < values.length; i++) {
String attr=values[i];
if (!(attr.equalsIgnoreCase("String_Node_Str") || attr.equalsIgnoreCase("String_Node_Str"))) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE,"String_Node_Str",attr);
}
req.setAttributes(values);
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) req.setIncludeIntersections(Boolean.parseBoolean(value));
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) {
try {
req.getRouteSearchParameters().setOptions(value);
}
 catch (Exception ex) {
throw new ParameterValueException(IsochronesErrorCodes.INVALID_JSON_FORMAT,"String_Node_Str",value);
}
}
value=request.getParameter("String_Node_Str");
if (!Helper.isEmpty(value)) req.setId(value);
return req;
}