Program: 44454
Project: 44454
Buggy source:
/** 
 * Route plan using osrm server.
 * @param param
 * @param host_port
 * @param http
 * @return
 * @throws IOException
 * @throws ParseException
 * @throws JAXBException
 * @throws InterruptedException
 */
public AbstractResponseParametersType routePlan(DetermineRouteRequestType param,String host_port,String http,Locale locale) throws IOException, JAXBException, ParseException, InterruptedException {
  DetermineRouteResponseType res=new DetermineRouteResponseType();
  RouteSummaryType routeSummary=new RouteSummaryType();
  RouteHandleType routeHandle=new RouteHandleType();
  RouteInstructionsListType routeInstructionsList=new RouteInstructionsListType();
  try {
    RouteGeometryType routeGeometry=new RouteGeometryType();
    WayPointListType wayPointList=param.getRoutePlan().getWayPointList();
    String url=http + "String_Node_Str" + host_port+ "String_Node_Str";
    CoordinateReferenceSystem sourceCRS=CRS.decode(EPSG_4326);
    CoordinateReferenceSystem targetCRS=GeoUtil.getSRS(wayPointList.getStartPoint());
    Point point=GeoUtil.getPoint(wayPointList.getStartPoint(),sourceCRS);
    url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    point=GeoUtil.getPoint(wayPointList.getEndPoint(),sourceCRS);
    url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    for (    WayPointType wayPoint : wayPointList.getViaPoint()) {
      point=GeoUtil.getPoint(wayPoint,sourceCRS);
      url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    }
    LOG.info(url);
    LineStringType lst=new LineStringType();
    lst.setSrsName(targetCRS.getName().getCode());
    JsonFactory f=new JsonFactory();
    JsonParser jp=f.createJsonParser(new URL(url));
    jp.nextToken();
    while (jp.nextToken() != JsonToken.END_OBJECT && jp.getCurrentToken() != null) {
      String fieldname=jp.getCurrentName();
      if (fieldname == null)       ;
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        DistanceType duration=new DistanceType();
        duration.setUom(DistanceUnitType.M);
        duration.setValue(new BigDecimal(jp.getText()));
        routeSummary.setTotalDistance(duration);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        Duration duration=dataTypeFactory.newDuration(true,0,0,0,0,0,jp.getIntValue());
        routeSummary.setTotalTime(duration);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        decodeRouteGeometry(lst.getPosOrPointPropertyOrPointRep(),targetCRS,sourceCRS,jp);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        processInstructions(locale,routeSummary,routeInstructionsList,jp);
      }
      jp.nextToken();
    }
    jp.close();
    routeGeometry.setLineString(lst);
    res.setRouteGeometry(routeGeometry);
    res.setRouteHandle(routeHandle);
    if (param.getRouteInstructionsRequest() != null)     res.setRouteInstructionsList(routeInstructionsList);
    res.getRouteInstructionsList().setFormat(MediaType.TEXT_PLAIN);
    res.getRouteInstructionsList().setLang(locale.getLanguage());
    res.setRouteSummary(routeSummary);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str" + t,t);
    t.printStackTrace();
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Route plan using osrm server.
 * @param param
 * @param host_port
 * @param http
 * @return
 * @throws IOException
 * @throws ParseException
 * @throws JAXBException
 * @throws InterruptedException
 */
public AbstractResponseParametersType routePlan(DetermineRouteRequestType param,String host_port,String http,Locale locale) throws IOException, JAXBException, ParseException, InterruptedException {
  DetermineRouteResponseType res=new DetermineRouteResponseType();
  RouteSummaryType routeSummary=new RouteSummaryType();
  RouteHandleType routeHandle=new RouteHandleType();
  RouteInstructionsListType routeInstructionsList=new RouteInstructionsListType();
  try {
    RouteGeometryType routeGeometry=new RouteGeometryType();
    WayPointListType wayPointList=param.getRoutePlan().getWayPointList();
    String url=http + "String_Node_Str" + host_port+ "String_Node_Str";
    CoordinateReferenceSystem sourceCRS=CRS.decode(EPSG_4326);
    CoordinateReferenceSystem targetCRS=GeoUtil.getSRS(wayPointList.getStartPoint());
    Point point=GeoUtil.getPoint(wayPointList.getStartPoint(),sourceCRS);
    url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    for (    WayPointType wayPoint : wayPointList.getViaPoint()) {
      point=GeoUtil.getPoint(wayPoint,sourceCRS);
      url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    }
    point=GeoUtil.getPoint(wayPointList.getEndPoint(),sourceCRS);
    url+="String_Node_Str" + point.getY() + "String_Node_Str"+ point.getX();
    LOG.info(url);
    LineStringType lst=new LineStringType();
    lst.setSrsName(targetCRS.getName().getCode());
    JsonFactory f=new JsonFactory();
    JsonParser jp=f.createJsonParser(new URL(url));
    jp.nextToken();
    while (jp.nextToken() != JsonToken.END_OBJECT && jp.getCurrentToken() != null) {
      String fieldname=jp.getCurrentName();
      if (fieldname == null)       ;
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        DistanceType duration=new DistanceType();
        duration.setUom(DistanceUnitType.M);
        duration.setValue(new BigDecimal(jp.getText()));
        routeSummary.setTotalDistance(duration);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        Duration duration=dataTypeFactory.newDuration(true,0,0,0,0,0,jp.getIntValue());
        routeSummary.setTotalTime(duration);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        decodeRouteGeometry(lst.getPosOrPointPropertyOrPointRep(),targetCRS,sourceCRS,jp);
      }
 else       if (jp.getCurrentName().equals("String_Node_Str")) {
        processInstructions(locale,routeSummary,routeInstructionsList,jp);
      }
      jp.nextToken();
    }
    jp.close();
    routeGeometry.setLineString(lst);
    res.setRouteGeometry(routeGeometry);
    res.setRouteHandle(routeHandle);
    if (param.getRouteInstructionsRequest() != null)     res.setRouteInstructionsList(routeInstructionsList);
    res.getRouteInstructionsList().setFormat(MediaType.TEXT_PLAIN);
    res.getRouteInstructionsList().setLang(locale.getLanguage());
    res.setRouteSummary(routeSummary);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str" + t,t);
    t.printStackTrace();
  }
  return res;
}