Program: 35396
Project: 35396
Buggy source:
public GHResponse computeRoute(double lat0,double lon0,double lat1,double lon1,WayPointBearing[] bearings,double[] radiuses,boolean directedSegment,RouteSearchParameters searchParams,EdgeFilter customEdgeFilter,boolean simplifyGeometry,RouteProcessContext routeProcCntx) throws Exception {
  GHResponse resp=null;
  waitForUpdateCompletion();
  beginUseGH();
  try {
    int profileType=searchParams.getProfileType();
    int weightingMethod=searchParams.getWeightingMethod();
    RouteSearchContext searchCntx=createSearchContext(searchParams,RouteSearchMode.Routing,customEdgeFilter);
    boolean flexibleMode=searchParams.getFlexibleMode();
    GHRequest req=null;
    if (bearings == null || bearings[0] == null)     req=new GHRequest(new GHPoint(lat0,lon0),new GHPoint(lat1,lon1));
 else     req=new GHRequest(new GHPoint(lat0,lon0),new GHPoint(lat1,lon1),bearings[0].getValue(),bearings[0].getDeviation(),bearings[1].getValue(),bearings[1].getDeviation());
    req.setVehicle(searchCntx.getEncoder().toString());
    req.setMaxSpeed(searchParams.getMaximumSpeed());
    req.setSimplifyGeometry(simplifyGeometry);
    req.setAlgorithm("String_Node_Str");
    if (radiuses != null)     req.setMaxSearchDistance(radiuses);
    PMap props=searchCntx.getProperties();
    if (props != null && props.size() > 0)     req.getHints().merge(props);
    if (supportWeightingMethod(profileType)) {
      if (weightingMethod == WeightingMethod.FASTEST) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
      }
 else       if (weightingMethod == WeightingMethod.SHORTEST) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
        flexibleMode=true;
      }
 else       if (weightingMethod == WeightingMethod.RECOMMENDED) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
        flexibleMode=true;
      }
    }
    if ((profileType == RoutingProfileType.CYCLING_TOUR || profileType == RoutingProfileType.CYCLING_MOUNTAIN) && weightingMethod == WeightingMethod.FASTEST) {
      req.setWeighting("String_Node_Str");
      req.getHints().put("String_Node_Str","String_Node_Str");
      flexibleMode=true;
    }
    if ((profileType == RoutingProfileType.CYCLING_TOUR || (profileType == RoutingProfileType.DRIVING_HGV && HeavyVehicleAttributes.HGV == searchParams.getVehicleType())) && weightingMethod == WeightingMethod.RECOMMENDED) {
      req.setWeighting("String_Node_Str");
      req.getHints().put("String_Node_Str","String_Node_Str");
      flexibleMode=true;
    }
    if (RoutingProfileType.isDriving(profileType) && RealTrafficDataProvider.getInstance().isInitialized())     req.setEdgeAnnotator(new TrafficEdgeAnnotator(mGraphHopper.getGraphHopperStorage()));
    req.setEdgeFilter(searchCntx.getEdgeFilter());
    req.setPathProcessor(routeProcCntx.getPathProcessor());
    if (useDynamicWeights(searchParams) || flexibleMode) {
      if (mGraphHopper.isCHEnabled())       req.getHints().put("String_Node_Str",true);
      if (mGraphHopper.getLMFactoryDecorator().isEnabled())       req.setAlgorithm("String_Node_Str");
      req.getHints().put("String_Node_Str",false);
    }
 else {
      if (mGraphHopper.isCHEnabled())       req.getHints().put("String_Node_Str",true);
 else       req.getHints().put("String_Node_Str",true);
    }
    if (profileType == RoutingProfileType.DRIVING_EMERGENCY) {
      req.getHints().put("String_Node_Str",true);
      req.getHints().put("String_Node_Str",true);
      req.getHints().put("String_Node_Str",true);
    }
    if (profileType == RoutingProfileType.DRIVING_CAR || profileType == RoutingProfileType.DRIVING_HGV || profileType == RoutingProfileType.DRIVING_ELECTRIC_CAR || profileType == RoutingProfileType.DRIVING_MOTORCYCLE) {
      req.getHints().put("String_Node_Str",true);
      req.getHints().put("String_Node_Str",true);
    }
    if (_astarEpsilon != null)     req.getHints().put("String_Node_Str",_astarEpsilon);
    if (_astarApproximation != null)     req.getHints().put("String_Node_Str",_astarApproximation);
    resp=mGraphHopper.route(req,routeProcCntx.getArrayBuffer());
    if (DebugUtility.isDebug()) {
      System.out.println("String_Node_Str" + resp.getHints().get("String_Node_Str","String_Node_Str"));
    }
    endUseGH();
  }
 catch (  Exception ex) {
    endUseGH();
    LOGGER.error(ex);
    throw new InternalServerException(RoutingErrorCodes.UNKNOWN,"String_Node_Str");
  }
  return resp;
}

Fixed version (ground truth):
public GHResponse computeRoute(double lat0,double lon0,double lat1,double lon1,WayPointBearing[] bearings,double[] radiuses,boolean directedSegment,RouteSearchParameters searchParams,EdgeFilter customEdgeFilter,boolean simplifyGeometry,RouteProcessContext routeProcCntx) throws Exception {
  GHResponse resp=null;
  waitForUpdateCompletion();
  beginUseGH();
  try {
    int profileType=searchParams.getProfileType();
    int weightingMethod=searchParams.getWeightingMethod();
    RouteSearchContext searchCntx=createSearchContext(searchParams,RouteSearchMode.Routing,customEdgeFilter);
    boolean flexibleMode=searchParams.getFlexibleMode();
    GHRequest req=null;
    if (bearings == null || bearings[0] == null)     req=new GHRequest(new GHPoint(lat0,lon0),new GHPoint(lat1,lon1));
 else     req=new GHRequest(new GHPoint(lat0,lon0),new GHPoint(lat1,lon1),bearings[0].getValue(),bearings[0].getDeviation(),bearings[1].getValue(),bearings[1].getDeviation());
    req.setVehicle(searchCntx.getEncoder().toString());
    req.setMaxSpeed(searchParams.getMaximumSpeed());
    req.setSimplifyGeometry(simplifyGeometry);
    req.setAlgorithm("String_Node_Str");
    if (radiuses != null)     req.setMaxSearchDistance(radiuses);
    PMap props=searchCntx.getProperties();
    if (props != null && props.size() > 0)     req.getHints().merge(props);
    if (supportWeightingMethod(profileType)) {
      if (weightingMethod == WeightingMethod.FASTEST) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
      }
 else       if (weightingMethod == WeightingMethod.SHORTEST) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
        flexibleMode=true;
      }
 else       if (weightingMethod == WeightingMethod.RECOMMENDED) {
        req.setWeighting("String_Node_Str");
        req.getHints().put("String_Node_Str","String_Node_Str");
        flexibleMode=true;
      }
    }
    if ((profileType == RoutingProfileType.CYCLING_TOUR || profileType == RoutingProfileType.CYCLING_MOUNTAIN) && weightingMethod == WeightingMethod.FASTEST) {
      req.setWeighting("String_Node_Str");
      req.getHints().put("String_Node_Str","String_Node_Str");
      flexibleMode=true;
    }
    if ((profileType == RoutingProfileType.CYCLING_TOUR || (profileType == RoutingProfileType.DRIVING_HGV && HeavyVehicleAttributes.HGV == searchParams.getVehicleType())) && weightingMethod == WeightingMethod.RECOMMENDED) {
      req.setWeighting("String_Node_Str");
      req.getHints().put("String_Node_Str","String_Node_Str");
      flexibleMode=true;
    }
    if (RoutingProfileType.isDriving(profileType) && RealTrafficDataProvider.getInstance().isInitialized())     req.setEdgeAnnotator(new TrafficEdgeAnnotator(mGraphHopper.getGraphHopperStorage()));
    req.setEdgeFilter(searchCntx.getEdgeFilter());
    req.setPathProcessor(routeProcCntx.getPathProcessor());
    if (useDynamicWeights(searchParams) || flexibleMode) {
      if (mGraphHopper.isCHEnabled())       req.getHints().put("String_Node_Str",true);
      if (mGraphHopper.getLMFactoryDecorator().isEnabled())       req.setAlgorithm("String_Node_Str");
      req.getHints().put("String_Node_Str",false);
    }
 else {
      if (mGraphHopper.isCHEnabled())       req.getHints().put("String_Node_Str",true);
 else       req.getHints().put("String_Node_Str",true);
    }
    if (profileType == RoutingProfileType.DRIVING_EMERGENCY) {
      req.getHints().put("String_Node_Str",true);
      req.getHints().put("String_Node_Str",true);
      req.getHints().put("String_Node_Str",true);
    }
    if (_astarEpsilon != null)     req.getHints().put("String_Node_Str",_astarEpsilon);
    if (_astarApproximation != null)     req.getHints().put("String_Node_Str",_astarApproximation);
    resp=mGraphHopper.route(req,routeProcCntx.getArrayBuffer());
    if (DebugUtility.isDebug()) {
      System.out.println("String_Node_Str" + resp.getHints().get("String_Node_Str","String_Node_Str"));
    }
    endUseGH();
  }
 catch (  Exception ex) {
    endUseGH();
    LOGGER.error(ex);
    throw new InternalServerException(RoutingErrorCodes.UNKNOWN,"String_Node_Str");
  }
  return resp;
}