Program: 189566
Project: 189566
Buggy source:
@Override public DataDistribution<VehicleState> createInitialParticles(int numParticles){
  final StandardRoadTrackingFilter trackingFilter=new StandardRoadTrackingFilter(parameters.getObsVariance(),parameters.getOffRoadStateVariance(),parameters.getOnRoadStateVariance());
  final MultivariateGaussian initialBelief=trackingFilter.createInitialLearnedObject();
  final Vector xyPoint=initialObservation.getProjectedPoint();
  initialBelief.setMean(VectorFactory.getDefault().copyArray(new double[]{xyPoint.getElement(0),0d,xyPoint.getElement(1),0d}));
  final List<StreetEdge> initialEdges=inferredGraph.getNearbyEdges(initialBelief,trackingFilter);
  final DataDistribution<VehicleState> initialDist=new DefaultDataDistribution<VehicleState>(numParticles);
  final Set<InferredPathEntry> evaluatedPaths=Sets.newHashSet();
  if (!initialEdges.isEmpty()) {
    for (    final Edge nativeEdge : initialEdges) {
      final InferredEdge edge=inferredGraph.getInferredEdge(nativeEdge);
      final PathEdge pathEdge=PathEdge.getEdge(edge,0d);
      final InferredPath path=InferredPath.getInferredPath(pathEdge);
      evaluatedPaths.add(new InferredPathEntry(path,null,null,Double.NEGATIVE_INFINITY));
      final VehicleState state=new VehicleState(this.inferredGraph,initialObservation,pathEdge.getInferredEdge(),parameters);
      final VehicleStateConditionalParams edgeLoc=new VehicleStateConditionalParams(pathEdge,initialObservation.getProjectedPoint());
      final double lik=state.getProbabilityFunction().evaluate(edgeLoc);
      initialDist.increment(state,lik);
    }
  }
  final VehicleState state=new VehicleState(this.inferredGraph,initialObservation,InferredEdge.getEmptyEdge(),parameters);
  final double lik=state.getProbabilityFunction().evaluate(new VehicleStateConditionalParams(initialObservation.getProjectedPoint()));
  initialDist.increment(state,lik);
  final DataDistribution<VehicleState> retDist=new DefaultDataDistribution<VehicleState>(initialDist.sample(threadRandom.get(),numParticles));
  return retDist;
}

Fixed version (ground truth):
@Override public DataDistribution<VehicleState> createInitialParticles(int numParticles){
  final StandardRoadTrackingFilter trackingFilter=new StandardRoadTrackingFilter(parameters.getObsVariance(),parameters.getOffRoadStateVariance(),parameters.getOnRoadStateVariance());
  final MultivariateGaussian initialBelief=trackingFilter.createInitialLearnedObject();
  final Vector xyPoint=initialObservation.getProjectedPoint();
  initialBelief.setMean(VectorFactory.getDefault().copyArray(new double[]{xyPoint.getElement(0),0d,xyPoint.getElement(1),0d}));
  final List<StreetEdge> initialEdges=inferredGraph.getNearbyEdges(initialBelief,trackingFilter);
  final DataDistribution<VehicleState> initialDist=new DefaultDataDistribution<VehicleState>(numParticles);
  final Set<InferredPathEntry> evaluatedPaths=Sets.newHashSet();
  if (!initialEdges.isEmpty()) {
    for (    final Edge nativeEdge : initialEdges) {
      final InferredEdge edge=inferredGraph.getInferredEdge(nativeEdge);
      final PathEdge pathEdge=PathEdge.getEdge(edge,0d);
      final InferredPath path=InferredPath.getInferredPath(pathEdge);
      evaluatedPaths.add(new InferredPathEntry(path,null,null,null,Double.NEGATIVE_INFINITY));
      final VehicleState state=new VehicleState(this.inferredGraph,initialObservation,pathEdge.getInferredEdge(),parameters);
      final VehicleStateConditionalParams edgeLoc=new VehicleStateConditionalParams(pathEdge,initialObservation.getProjectedPoint());
      final double lik=state.getProbabilityFunction().evaluate(edgeLoc);
      initialDist.increment(state,lik);
    }
  }
  final VehicleState state=new VehicleState(this.inferredGraph,initialObservation,InferredEdge.getEmptyEdge(),parameters);
  final double lik=state.getProbabilityFunction().evaluate(new VehicleStateConditionalParams(initialObservation.getProjectedPoint()));
  initialDist.increment(state,lik);
  final DataDistribution<VehicleState> retDist=new DefaultDataDistribution<VehicleState>(initialDist.sample(threadRandom.get(),numParticles));
  return retDist;
}