Program: 35406
Project: 35406
Buggy source:
/** 
 * Based on the hintsMap and the specified encoder a Weighting instance can be created. Note that all URL parameters are available in the hintsMap as String if you use the web module.
 * @param hintsMap all parameters influencing the weighting. E.g. parameters coming viaGHRequest.getHints or directly via "&amp;api.xy=" from the URL of the web UI
 * @param encoder  the required vehicle
 * @param graph    The Graph enables the Weighting for NodeAccess and more
 * @return the weighting to be used for route calculation
 * @see HintsMap
 */
public Weighting createWeighting(HintsMap hintsMap,FlagEncoder encoder,Graph graph,GraphHopperStorage graphStorage){
  if (weightingFactory != null) {
    return weightingFactory.createWeighting(hintsMap,encoder,graph,locationIndex,graphStorage);
  }
  String weightingStr=hintsMap.getWeighting().toLowerCase();
  Weighting weighting=null;
  if (encoder.supports(GenericWeighting.class)) {
    weighting=new GenericWeighting((DataFlagEncoder)encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    weighting=new ShortestWeighting(encoder);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr) || weightingStr.isEmpty()) {
    if (encoder.supports(PriorityWeighting.class))     weighting=new PriorityWeighting(encoder,hintsMap);
 else     weighting=new FastestWeighting(encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    if (encoder.supports(CurvatureWeighting.class))     weighting=new CurvatureWeighting(encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    weighting=new ShortFastestWeighting(encoder,hintsMap);
  }
  if (weighting == null)   throw new IllegalArgumentException("String_Node_Str" + weighting + "String_Node_Str");
  if (hintsMap.has(Routing.BLOCK_AREA)) {
    String blockAreaStr=hintsMap.get(Parameters.Routing.BLOCK_AREA,"String_Node_Str");
    GraphEdgeIdFinder.BlockArea blockArea=new GraphEdgeIdFinder(graph,locationIndex).parseBlockArea(blockAreaStr,new DefaultEdgeFilter(encoder));
    return new BlockAreaWeighting(weighting,blockArea);
  }
  return weighting;
}

Fixed version (ground truth):
/** 
 * Based on the hintsMap and the specified encoder a Weighting instance can be created. Note that all URL parameters are available in the hintsMap as String if you use the web module.
 * @param hintsMap all parameters influencing the weighting. E.g. parameters coming viaGHRequest.getHints or directly via "&amp;api.xy=" from the URL of the web UI
 * @param encoder  the required vehicle
 * @param graph    The Graph enables the Weighting for NodeAccess and more
 * @return the weighting to be used for route calculation
 * @see HintsMap
 */
public Weighting createWeighting(HintsMap hintsMap,TraversalMode tMode,FlagEncoder encoder,Graph graph,GraphHopperStorage graphStorage){
  if (weightingFactory != null) {
    return weightingFactory.createWeighting(hintsMap,tMode,encoder,graph,locationIndex,graphStorage);
  }
  String weightingStr=hintsMap.getWeighting().toLowerCase();
  Weighting weighting=null;
  if (encoder.supports(GenericWeighting.class)) {
    weighting=new GenericWeighting((DataFlagEncoder)encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    weighting=new ShortestWeighting(encoder);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr) || weightingStr.isEmpty()) {
    if (encoder.supports(PriorityWeighting.class))     weighting=new PriorityWeighting(encoder,hintsMap);
 else     weighting=new FastestWeighting(encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    if (encoder.supports(CurvatureWeighting.class))     weighting=new CurvatureWeighting(encoder,hintsMap);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(weightingStr)) {
    weighting=new ShortFastestWeighting(encoder,hintsMap);
  }
  if (weighting == null)   throw new IllegalArgumentException("String_Node_Str" + weighting + "String_Node_Str");
  if (hintsMap.has(Routing.BLOCK_AREA)) {
    String blockAreaStr=hintsMap.get(Parameters.Routing.BLOCK_AREA,"String_Node_Str");
    GraphEdgeIdFinder.BlockArea blockArea=new GraphEdgeIdFinder(graph,locationIndex).parseBlockArea(blockAreaStr,new DefaultEdgeFilter(encoder));
    return new BlockAreaWeighting(weighting,blockArea);
  }
  return weighting;
}