Program: 35422
Project: 35422
Buggy source:
@Override public void processEdge(int pathIndex,EdgeIteratorState edge,boolean lastEdge,PointList geom){
  double dist=edge.getDistance();
  if (_extWaySurface != null && _wayTypeInfo != null || _surfaceInfo != null) {
    WaySurfaceDescription wsd=_extWaySurface.getEdgeValue(edge.getOriginalEdge(),buffer);
    if (_surfaceInfoBuilder != null)     _surfaceInfoBuilder.addSegment(wsd.SurfaceType,wsd.SurfaceType,geom,dist,lastEdge && _lastSegment);
    if (_wayTypeInfo != null)     _wayTypeInfoBuilder.addSegment(wsd.WayType,wsd.WayType,geom,dist,lastEdge && _lastSegment);
  }
  if (_wayCategoryInfoBuilder != null) {
    int value=_extWayCategory.getEdgeValue(edge.getOriginalEdge(),buffer);
    _wayCategoryInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_trailDifficultyInfoBuilder != null) {
    int value=0;
    if (RoutingProfileType.isCycling(_profileType)) {
      boolean uphill=false;
      if (_extHillIndex != null) {
        boolean revert=edge.getBaseNode() > edge.getAdjNode();
        int hillIndex=_extHillIndex.getEdgeValue(edge.getOriginalEdge(),revert,buffer);
        if (hillIndex > 0)         uphill=true;
      }
      value=_extTrailDifficulty.getMtbScale(edge.getOriginalEdge(),buffer,uphill);
    }
 else     if (RoutingProfileType.isWalking(_profileType))     value=_extTrailDifficulty.getHikingScale(edge.getOriginalEdge(),buffer);
    _trailDifficultyInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_avgSpeedInfoBuilder != null) {
    double speed=_encoder.getSpeed(edge.getFlags(_encoder.getIndex()));
    _avgSpeedInfoBuilder.addSegment(speed,(int)Math.round(speed * _avgSpeedInfo.getFactor()),geom,dist,lastEdge && _lastSegment);
  }
  if (_tollwaysInfoBuilder != null) {
    int value=_tollwayExtractor.getValue(edge.getOriginalEdge());
    _tollwaysInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_waySuitabilityInfoBuilder != null) {
    double priority=0.3;
    int priorityIndex=3;
    if (_encoderWithPriority) {
      priority=_encoder.getDouble(edge.getFlags(_encoder.getIndex()),101);
      priorityIndex=(int)(3 + priority * PriorityCode.BEST.getValue());
    }
 else {
      priority=_encoder.getSpeed(edge.getFlags(_encoder.getIndex())) / _encoder.getMaxSpeed();
      if (priority < 0.3)       priority=0.3;
      priorityIndex=(int)(priority * 10);
    }
    _waySuitabilityInfoBuilder.addSegment(priority,priorityIndex,geom,dist,lastEdge && _lastSegment);
  }
  if (_steepnessInfoBuilder != null) {
    _steepnessInfoBuilder.addSegment(0,0,geom,dist,lastEdge && _lastSegment);
  }
  if (_greenInfoBuilder != null) {
    int value=_extGreenIndex.getEdgeValue(edge.getOriginalEdge(),buffer);
    int MIN_CLIENT_VAL=3;
    int MAX_CLIENT_VAL=10;
    int clientVal=MIN_CLIENT_VAL + value * (MAX_CLIENT_VAL - MIN_CLIENT_VAL + 1) / 64;
    _greenInfoBuilder.addSegment(value,clientVal,geom,dist,lastEdge && _lastSegment);
  }
  if (_noiseInfoBuilder != null) {
    int noise_level=_extNoiseIndex.getEdgeValue(edge.getOriginalEdge(),buffer);
    if (noise_level > 3)     noise_level=3;
    int client_noise_level=noise_level + 7;
    _noiseInfoBuilder.addSegment(noise_level,client_noise_level,geom,dist,lastEdge && _lastSegment);
  }
}

Fixed version (ground truth):
@Override public void processEdge(int pathIndex,EdgeIteratorState edge,boolean lastEdge,PointList geom){
  double dist=edge.getDistance();
  if (_extWaySurface != null && _wayTypeInfo != null || _surfaceInfo != null) {
    WaySurfaceDescription wsd=_extWaySurface.getEdgeValue(edge.getOriginalEdge(),buffer);
    if (_surfaceInfoBuilder != null)     _surfaceInfoBuilder.addSegment(wsd.SurfaceType,wsd.SurfaceType,geom,dist,lastEdge && _lastSegment);
    if (_wayTypeInfo != null)     _wayTypeInfoBuilder.addSegment(wsd.WayType,wsd.WayType,geom,dist,lastEdge && _lastSegment);
  }
  if (_wayCategoryInfoBuilder != null) {
    int value=_extWayCategory.getEdgeValue(edge.getOriginalEdge(),buffer);
    _wayCategoryInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_trailDifficultyInfoBuilder != null) {
    int value=0;
    if (RoutingProfileType.isCycling(_profileType)) {
      boolean uphill=false;
      if (_extHillIndex != null) {
        boolean revert=edge.getBaseNode() > edge.getAdjNode();
        int hillIndex=_extHillIndex.getEdgeValue(edge.getOriginalEdge(),revert,buffer);
        if (hillIndex > 0)         uphill=true;
      }
      value=_extTrailDifficulty.getMtbScale(edge.getOriginalEdge(),buffer,uphill);
    }
 else     if (RoutingProfileType.isWalking(_profileType))     value=_extTrailDifficulty.getHikingScale(edge.getOriginalEdge(),buffer);
    _trailDifficultyInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_avgSpeedInfoBuilder != null) {
    double speed=_encoder.getSpeed(edge.getFlags(_encoder.getIndex()));
    if (_maximumSpeed > 0 && speed > _maximumSpeed)     speed=_maximumSpeed;
    _avgSpeedInfoBuilder.addSegment(speed,(int)Math.round(speed * _avgSpeedInfo.getFactor()),geom,dist,lastEdge && _lastSegment);
  }
  if (_tollwaysInfoBuilder != null) {
    int value=_tollwayExtractor.getValue(edge.getOriginalEdge());
    _tollwaysInfoBuilder.addSegment(value,value,geom,dist,lastEdge && _lastSegment);
  }
  if (_waySuitabilityInfoBuilder != null) {
    double priority=0.3;
    int priorityIndex=3;
    if (_encoderWithPriority) {
      priority=_encoder.getDouble(edge.getFlags(_encoder.getIndex()),101);
      priorityIndex=(int)(3 + priority * PriorityCode.BEST.getValue());
    }
 else {
      priority=_encoder.getSpeed(edge.getFlags(_encoder.getIndex())) / _encoder.getMaxSpeed();
      if (priority < 0.3)       priority=0.3;
      priorityIndex=(int)(priority * 10);
    }
    _waySuitabilityInfoBuilder.addSegment(priority,priorityIndex,geom,dist,lastEdge && _lastSegment);
  }
  if (_steepnessInfoBuilder != null) {
    _steepnessInfoBuilder.addSegment(0,0,geom,dist,lastEdge && _lastSegment);
  }
  if (_greenInfoBuilder != null) {
    int value=_extGreenIndex.getEdgeValue(edge.getOriginalEdge(),buffer);
    int MIN_CLIENT_VAL=3;
    int MAX_CLIENT_VAL=10;
    int clientVal=MIN_CLIENT_VAL + value * (MAX_CLIENT_VAL - MIN_CLIENT_VAL + 1) / 64;
    _greenInfoBuilder.addSegment(value,clientVal,geom,dist,lastEdge && _lastSegment);
  }
  if (_noiseInfoBuilder != null) {
    int noise_level=_extNoiseIndex.getEdgeValue(edge.getOriginalEdge(),buffer);
    if (noise_level > 3)     noise_level=3;
    int client_noise_level=noise_level + 7;
    _noiseInfoBuilder.addSegment(noise_level,client_noise_level,geom,dist,lastEdge && _lastSegment);
  }
}