Program: 42783
Project: 42783
Buggy source:
@Override public void run(){
  System.out.println("String_Node_Str");
  try {
    JSONParser parser=new JSONParser();
    FileReader reader=new FileReader(path);
    JSONObject completeLogFile=(JSONObject)parser.parse(reader);
    Date loggingDate=new Date();
    long prevTimeInMillis=loggingDate.getTime();
    JSONArray sensorDataArray=(JSONArray)completeLogFile.get("String_Node_Str");
    long sensorStartTimeInMilis=0;
    for (    Object senObj : sensorDataArray) {
      JSONObject sensor=(JSONObject)senObj;
      Date sensorTimestamp=RobobuggyDateFormatter.formatRobobuggyDate((String)sensor.get("String_Node_Str"));
      long currentSensorTimeInMillis=sensorTimestamp.getTime();
      long currentTime=loggingDate.getTime();
      if (sensorStartTimeInMilis == 0) {
        sensorStartTimeInMilis=currentSensorTimeInMillis;
      }
      long sensorTimeFromStart=currentSensorTimeInMillis - sensorStartTimeInMilis;
      long realTimeFromStart=currentTime - prevTimeInMillis;
      long playbackSpeed=100;
      long sleepTime=playbackSpeed * realTimeFromStart - sensorTimeFromStart;
      new RobobuggyLogicNotification("String_Node_Str" + sleepTime,RobobuggyMessageLevel.NOTE);
      if (sleepTime < 0 && false) {
        Thread.sleep(-sleepTime / 1000000);
      }
      String sensorName=(String)sensor.get("String_Node_Str");
      if (sensorName == null) {
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      }
 else {
        JSONObject sensorParams=(JSONObject)sensor.get("String_Node_Str");
        System.out.println(sensorName);
switch (sensorName) {
case "String_Node_Str":
          double yaw=(double)sensorParams.get("String_Node_Str");
        double pitch=(double)sensorParams.get("String_Node_Str");
      double roll=(double)sensorParams.get("String_Node_Str");
    imuPub.publish(new ImuMeasurement(yaw,pitch,roll));
  break;
case "String_Node_Str":
double latitude=(double)sensorParams.get("String_Node_Str");
double longitude=(double)sensorParams.get("String_Node_Str");
String latDir=(String)sensorParams.get("String_Node_Str");
String longDir=(String)sensorParams.get("String_Node_Str");
boolean north=latDir.equals("String_Node_Str");
boolean west=longDir.equals("String_Node_Str");
String gpsTimestampString=(String)sensor.get("String_Node_Str");
Date gpsTimestamp=RobobuggyDateFormatter.formatRobobuggyDate(gpsTimestampString);
int qualityValue=Integer.valueOf((String)sensorParams.get("String_Node_Str"));
int numSatellites=Integer.valueOf((String)sensorParams.get("String_Node_Str"));
double hdop=(double)sensorParams.get("String_Node_Str");
double antennaAlt=(double)sensorParams.get("String_Node_Str");
double rawLat=(double)sensorParams.get("String_Node_Str");
double rawLon=(double)sensorParams.get("String_Node_Str");
gpsPub.publish(new GpsMeasurement(gpsTimestamp,latitude,north,longitude,west,qualityValue,numSatellites,hdop,antennaAlt,rawLat,rawLon));
break;
case "String_Node_Str":
String loggingStatus=(String)sensorParams.get("String_Node_Str");
GuiLoggingButtonMessage.LoggingMessage loggingMessage=LoggingMessage.STOP;
switch (loggingStatus) {
case "String_Node_Str":
loggingMessage=LoggingMessage.START;
break;
case "String_Node_Str":
loggingMessage=LoggingMessage.STOP;
break;
default :
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
break;
}
loggingButtonPub.publish(new GuiLoggingButtonMessage(loggingMessage));
break;
case "String_Node_Str":
double steeringAngle=(double)sensorParams.get("String_Node_Str");
steeringPub.publish(new SteeringMeasurement((int)steeringAngle));
break;
case "String_Node_Str":
double dataword=(double)sensorParams.get("String_Node_Str");
double distance=(double)sensorParams.get("String_Node_Str");
double velocity=0;
if (sensorParams.get("String_Node_Str") != null) velocity=(double)sensorParams.get("String_Node_Str");
double accel=0;
if (sensorParams.get("String_Node_Str") != null) accel=(double)sensorParams.get("String_Node_Str");
String timestampString=(String)sensor.get("String_Node_Str");
Date timestamp=RobobuggyDateFormatter.formatRobobuggyDate(timestampString);
encoderPub.publish(new EncoderMeasurement(timestamp,dataword,distance,velocity,accel));
break;
case "String_Node_Str":
break;
default :
break;
}
}
}
}
 catch (IOException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
}
catch (InterruptedException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.WARNING);
}
catch (ParseException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
}
}

Fixed version (ground truth):
@Override public void run(){
  System.out.println("String_Node_Str");
  try {
    JSONParser parser=new JSONParser();
    InputStreamReader reader=new InputStreamReader(new FileInputStream(path),"String_Node_Str");
    JSONObject completeLogFile=(JSONObject)parser.parse(reader);
    Date loggingDate=new Date();
    long prevTimeInMillis=loggingDate.getTime();
    JSONArray sensorDataArray=(JSONArray)completeLogFile.get("String_Node_Str");
    long sensorStartTimeInMilis=0;
    for (    Object senObj : sensorDataArray) {
      JSONObject sensor=(JSONObject)senObj;
      Date sensorTimestamp=RobobuggyDateFormatter.formatRobobuggyDate((String)sensor.get("String_Node_Str"));
      long currentSensorTimeInMillis=sensorTimestamp.getTime();
      long currentTime=loggingDate.getTime();
      if (sensorStartTimeInMilis == 0) {
        sensorStartTimeInMilis=currentSensorTimeInMillis;
      }
      long sensorTimeFromStart=currentSensorTimeInMillis - sensorStartTimeInMilis;
      long realTimeFromStart=currentTime - prevTimeInMillis;
      long playbackSpeed=100;
      long sleepTime=playbackSpeed * realTimeFromStart - sensorTimeFromStart;
      new RobobuggyLogicNotification("String_Node_Str" + sleepTime,RobobuggyMessageLevel.NOTE);
      if (sleepTime < 0 && false) {
        Thread.sleep(-sleepTime / 1000000);
      }
      String sensorName=(String)sensor.get("String_Node_Str");
      if (sensorName == null) {
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      }
 else {
        JSONObject sensorParams=(JSONObject)sensor.get("String_Node_Str");
        System.out.println(sensorName);
switch (sensorName) {
case "String_Node_Str":
          double yaw=(double)sensorParams.get("String_Node_Str");
        double pitch=(double)sensorParams.get("String_Node_Str");
      double roll=(double)sensorParams.get("String_Node_Str");
    imuPub.publish(new ImuMeasurement(yaw,pitch,roll));
  break;
case "String_Node_Str":
double latitude=(double)sensorParams.get("String_Node_Str");
double longitude=(double)sensorParams.get("String_Node_Str");
String latDir=(String)sensorParams.get("String_Node_Str");
String longDir=(String)sensorParams.get("String_Node_Str");
boolean north=latDir.equals("String_Node_Str");
boolean west=longDir.equals("String_Node_Str");
String gpsTimestampString=(String)sensor.get("String_Node_Str");
Date gpsTimestamp=RobobuggyDateFormatter.formatRobobuggyDate(gpsTimestampString);
int qualityValue=Integer.parseInt((String)sensorParams.get("String_Node_Str"));
int numSatellites=Integer.parseInt((String)sensorParams.get("String_Node_Str"));
double hdop=(double)sensorParams.get("String_Node_Str");
double antennaAlt=(double)sensorParams.get("String_Node_Str");
double rawLat=(double)sensorParams.get("String_Node_Str");
double rawLon=(double)sensorParams.get("String_Node_Str");
gpsPub.publish(new GpsMeasurement(gpsTimestamp,latitude,north,longitude,west,qualityValue,numSatellites,hdop,antennaAlt,rawLat,rawLon));
break;
case "String_Node_Str":
String loggingStatus=(String)sensorParams.get("String_Node_Str");
GuiLoggingButtonMessage.LoggingMessage loggingMessage=LoggingMessage.STOP;
switch (loggingStatus) {
case "String_Node_Str":
loggingMessage=LoggingMessage.START;
break;
case "String_Node_Str":
loggingMessage=LoggingMessage.STOP;
break;
default :
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
break;
}
loggingButtonPub.publish(new GuiLoggingButtonMessage(loggingMessage));
break;
case "String_Node_Str":
double steeringAngle=(double)sensorParams.get("String_Node_Str");
steeringPub.publish(new SteeringMeasurement((int)steeringAngle));
break;
case "String_Node_Str":
double dataword=(double)sensorParams.get("String_Node_Str");
double distance=(double)sensorParams.get("String_Node_Str");
double velocity=0;
if (sensorParams.get("String_Node_Str") != null) velocity=(double)sensorParams.get("String_Node_Str");
double accel=0;
if (sensorParams.get("String_Node_Str") != null) accel=(double)sensorParams.get("String_Node_Str");
String timestampString=(String)sensor.get("String_Node_Str");
Date timestamp=RobobuggyDateFormatter.formatRobobuggyDate(timestampString);
encoderPub.publish(new EncoderMeasurement(timestamp,dataword,distance,velocity,accel));
break;
case "String_Node_Str":
break;
default :
break;
}
}
}
}
 catch (IOException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
}
catch (InterruptedException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.WARNING);
}
catch (ParseException e) {
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
}
}