Program: 189587
Project: 189587
Buggy source:
public void runSimulation(){
  Observation initialObs;
  try {
    try {
      initialObs=Observation.createObservation(this.simulationName,startTime,startCoordinates,null,null,null);
    }
 catch (    TimeOrderException e) {
      e.printStackTrace();
      return;
    }
    final SnappedEdges initialEdges=Api.getGraph().snapToGraph(null,initialObs.getObsCoords());
    List<InferredEdge> edges=Lists.newArrayList(InferredGraph.getEmptyEdge());
    for (    Edge edge : initialEdges.getSnappedEdges()) {
      edges.add(inferredGraph.getInferredEdge(edge));
    }
    final InferredEdge currentInferredEdge=edges.get(rng.nextInt(edges.size()));
    InferredPath currentPath=currentInferredEdge == InferredGraph.getEmptyEdge() ? InferredPath.getEmptyPath() : new InferredPath(currentInferredEdge);
    PathEdge currentPathEdge=Iterables.getOnlyElement(currentPath.getEdges());
    VehicleState vehicleState=new VehicleState(this.inferredGraph,initialObs,currentInferredEdge);
    Vector thisStateSample=sampleBelief(vehicleState);
    vehicleState.getBelief().setMean(thisStateSample);
    for (long time=startTime.getTime() + frequency * 1000; time < endTime.getTime(); time+=frequency * 1000) {
      vehicleState.getMovementFilter().setCurrentTimeDiff(frequency);
      final MultivariateGaussian currentLocBelief=vehicleState.getBelief();
      final EdgeTransitionDistributions currentEdgeTrans=vehicleState.getEdgeTransitionDist();
      currentPath=traverseEdge(vehicleState.getEdgeTransitionDist(),currentLocBelief,currentPathEdge,vehicleState.getMovementFilter());
      Vector transStateSample=sampleBelief(vehicleState);
      vehicleState.getBelief().setMean(transStateSample);
      currentPathEdge=Iterables.getLast(currentPath.getEdges());
      Vector thisLoc=sampleObservation(vehicleState,currentPathEdge);
      Coordinate obsCoord=GeoUtils.convertToLatLon(thisLoc);
      Observation thisObs;
      try {
        thisObs=Observation.createObservation(simulationName,new Date(time),obsCoord,null,null,null);
      }
 catch (      TimeOrderException e) {
        e.printStackTrace();
        continue;
      }
      InferenceResultRecord result=InferenceResultRecord.createInferenceResultRecord(thisObs,currentLocBelief,currentPath.getEdges());
      InferenceService.addSimulationRecords(simulationName,result);
      Logger.info("String_Node_Str" + thisObs);
      vehicleState=new VehicleState(this.inferredGraph,thisObs,vehicleState.getMovementFilter(),currentLocBelief,currentEdgeTrans,currentPathEdge,currentPath,vehicleState);
    }
  }
 catch (  NumberFormatException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void runSimulation(){
  Observation initialObs;
  try {
    try {
      initialObs=Observation.createObservation(this.simulationName,startTime,startCoordinates,null,null,null);
    }
 catch (    TimeOrderException e) {
      e.printStackTrace();
      return;
    }
    inferredGraph.getNearbyEdges(initialObs.getProjectedPoint());
    List<InferredEdge> edges=Lists.newArrayList(InferredGraph.getEmptyEdge());
    final InferredEdge currentInferredEdge=edges.get(rng.nextInt(edges.size()));
    InferredPath currentPath=currentInferredEdge == InferredGraph.getEmptyEdge() ? InferredPath.getEmptyPath() : new InferredPath(currentInferredEdge);
    PathEdge currentPathEdge=Iterables.getOnlyElement(currentPath.getEdges());
    VehicleState vehicleState=new VehicleState(this.inferredGraph,initialObs,currentInferredEdge);
    Vector thisStateSample=sampleMovementBelief(vehicleState);
    vehicleState.getBelief().setMean(thisStateSample);
    for (long time=startTime.getTime() + frequency * 1000; time < endTime.getTime(); time+=frequency * 1000) {
      vehicleState.getMovementFilter().setCurrentTimeDiff(frequency);
      final MultivariateGaussian currentLocBelief=vehicleState.getBelief();
      final EdgeTransitionDistributions currentEdgeTrans=vehicleState.getEdgeTransitionDist();
      currentPath=traverseEdge(vehicleState.getEdgeTransitionDist(),currentLocBelief,currentPathEdge,vehicleState.getMovementFilter());
      Vector transStateSample=sampleMovementBelief(vehicleState);
      vehicleState.getBelief().setMean(transStateSample);
      currentPathEdge=Iterables.getLast(currentPath.getEdges());
      Vector thisLoc=sampleObservation(vehicleState,currentPathEdge);
      Coordinate obsCoord=GeoUtils.convertToLatLon(thisLoc);
      Observation thisObs;
      try {
        thisObs=Observation.createObservation(simulationName,new Date(time),obsCoord,null,null,null);
      }
 catch (      TimeOrderException e) {
        e.printStackTrace();
        continue;
      }
      InferenceResultRecord result=InferenceResultRecord.createInferenceResultRecord(thisObs,currentLocBelief,currentPath.getEdges());
      InferenceService.addSimulationRecords(simulationName,result);
      Logger.info("String_Node_Str" + thisObs);
      vehicleState=new VehicleState(this.inferredGraph,thisObs,vehicleState.getMovementFilter(),currentLocBelief,currentEdgeTrans,currentPathEdge,currentPath,vehicleState);
    }
  }
 catch (  NumberFormatException e) {
    e.printStackTrace();
  }
}