Program: 94740
Project: 94740
Buggy source:
@Override public void onMavLinkMessageReceived(MAVLinkMessage message){
  final int compId=message.compid;
  if (compId != AUTOPILOT_COMPONENT_ID && compId != ARTOO_COMPONENT_ID && compId != TELEMETRY_RADIO_COMPONENT_ID) {
    return;
  }
  onHeartbeat(message);
  if (getParameters().processMessage(message)) {
    return;
  }
  getWaypointManager().processMessage(message);
  getCalibrationSetup().processMessage(message);
switch (message.msgid) {
case msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT:
    msg_heartbeat msg_heart=(msg_heartbeat)message;
  checkIfFlying(msg_heart);
processState(msg_heart);
ApmModes newMode=ApmModes.getMode(msg_heart.custom_mode,getType());
getState().setMode(newMode);
break;
case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT:
msg_statustext msg_statustext=(msg_statustext)message;
processStatusText(msg_statustext);
break;
case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD:
processVfrHud((msg_vfr_hud)message);
break;
case msg_mission_current.MAVLINK_MSG_ID_MISSION_CURRENT:
getMissionStats().setWpno(((msg_mission_current)message).seq);
break;
case msg_mission_item_reached.MAVLINK_MSG_ID_MISSION_ITEM_REACHED:
getMissionStats().setLastReachedWaypointNumber(((msg_mission_item_reached)message).seq);
break;
case msg_nav_controller_output.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT:
msg_nav_controller_output m_nav=(msg_nav_controller_output)message;
setDisttowpAndSpeedAltErrors(m_nav.wp_dist,m_nav.alt_error,m_nav.aspd_error);
break;
case msg_raw_imu.MAVLINK_MSG_ID_RAW_IMU:
msg_raw_imu msg_imu=(msg_raw_imu)message;
getMagnetometer().newData(msg_imu);
break;
case msg_global_position_int.MAVLINK_MSG_ID_GLOBAL_POSITION_INT:
processGlobalPositionInt((msg_global_position_int)message);
break;
case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS:
msg_sys_status m_sys=(msg_sys_status)message;
processBatteryUpdate(m_sys.voltage_battery / 1000.0,m_sys.battery_remaining,m_sys.current_battery / 100.0);
checkControlSensorsHealth(m_sys);
break;
case msg_radio.MAVLINK_MSG_ID_RADIO:
msg_radio m_radio=(msg_radio)message;
processSignalUpdate(m_radio.rxerrors,m_radio.fixed,m_radio.rssi,m_radio.remrssi,m_radio.txbuf,m_radio.noise,m_radio.remnoise);
break;
case msg_gps_raw_int.MAVLINK_MSG_ID_GPS_RAW_INT:
getGps().setGpsState(((msg_gps_raw_int)message).fix_type,((msg_gps_raw_int)message).satellites_visible,((msg_gps_raw_int)message).eph);
break;
case msg_rc_channels_raw.MAVLINK_MSG_ID_RC_CHANNELS_RAW:
rc.setRcInputValues((msg_rc_channels_raw)message);
break;
case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
rc.setRcOutputValues((msg_servo_output_raw)message);
break;
case msg_camera_feedback.MAVLINK_MSG_ID_CAMERA_FEEDBACK:
getCamera().newImageLocation((msg_camera_feedback)message);
break;
case msg_mount_status.MAVLINK_MSG_ID_MOUNT_STATUS:
processMountStatus((msg_mount_status)message);
break;
case msg_named_value_int.MAVLINK_MSG_ID_NAMED_VALUE_INT:
processNamedValueInt((msg_named_value_int)message);
break;
case msg_mag_cal_progress.MAVLINK_MSG_ID_MAG_CAL_PROGRESS:
case msg_mag_cal_report.MAVLINK_MSG_ID_MAG_CAL_REPORT:
getMagnetometerCalibration().processCalibrationMessage(message);
break;
case msg_mission_item.MAVLINK_MSG_ID_MISSION_ITEM:
msg_mission_item missionItem=(msg_mission_item)message;
if (missionItem.seq == Home.HOME_WAYPOINT_INDEX) {
home.setHome(missionItem);
}
break;
default :
break;
}
super.onMavLinkMessageReceived(message);
}

Fixed version (ground truth):
@Override public void onMavLinkMessageReceived(MAVLinkMessage message){
  final int compId=message.compid;
  if (compId != AUTOPILOT_COMPONENT_ID && compId != ARTOO_COMPONENT_ID && compId != TELEMETRY_RADIO_COMPONENT_ID) {
    return;
  }
  onHeartbeat(message);
  if (getParameters().processMessage(message)) {
    return;
  }
  getWaypointManager().processMessage(message);
  getCalibrationSetup().processMessage(message);
switch (message.msgid) {
case msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT:
    msg_heartbeat msg_heart=(msg_heartbeat)message;
  checkIfFlying(msg_heart);
processState(msg_heart);
ApmModes newMode=ApmModes.getMode(msg_heart.custom_mode,getType());
getState().setMode(newMode);
break;
case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT:
msg_statustext msg_statustext=(msg_statustext)message;
processStatusText(msg_statustext);
break;
case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD:
processVfrHud((msg_vfr_hud)message);
break;
case msg_mission_current.MAVLINK_MSG_ID_MISSION_CURRENT:
getMissionStats().setWpno(((msg_mission_current)message).seq);
break;
case msg_mission_item_reached.MAVLINK_MSG_ID_MISSION_ITEM_REACHED:
getMissionStats().setLastReachedWaypointNumber(((msg_mission_item_reached)message).seq);
break;
case msg_nav_controller_output.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT:
msg_nav_controller_output m_nav=(msg_nav_controller_output)message;
setDisttowpAndSpeedAltErrors(m_nav.wp_dist,m_nav.alt_error,m_nav.aspd_error);
break;
case msg_raw_imu.MAVLINK_MSG_ID_RAW_IMU:
msg_raw_imu msg_imu=(msg_raw_imu)message;
getMagnetometer().newData(msg_imu);
break;
case msg_radio.MAVLINK_MSG_ID_RADIO:
msg_radio m_radio=(msg_radio)message;
processSignalUpdate(m_radio.rxerrors,m_radio.fixed,m_radio.rssi,m_radio.remrssi,m_radio.txbuf,m_radio.noise,m_radio.remnoise);
break;
case msg_rc_channels_raw.MAVLINK_MSG_ID_RC_CHANNELS_RAW:
rc.setRcInputValues((msg_rc_channels_raw)message);
break;
case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
rc.setRcOutputValues((msg_servo_output_raw)message);
break;
case msg_camera_feedback.MAVLINK_MSG_ID_CAMERA_FEEDBACK:
getCamera().newImageLocation((msg_camera_feedback)message);
break;
case msg_mount_status.MAVLINK_MSG_ID_MOUNT_STATUS:
processMountStatus((msg_mount_status)message);
break;
case msg_named_value_int.MAVLINK_MSG_ID_NAMED_VALUE_INT:
processNamedValueInt((msg_named_value_int)message);
break;
case msg_mag_cal_progress.MAVLINK_MSG_ID_MAG_CAL_PROGRESS:
case msg_mag_cal_report.MAVLINK_MSG_ID_MAG_CAL_REPORT:
getMagnetometerCalibration().processCalibrationMessage(message);
break;
case msg_mission_item.MAVLINK_MSG_ID_MISSION_ITEM:
msg_mission_item missionItem=(msg_mission_item)message;
if (missionItem.seq == Home.HOME_WAYPOINT_INDEX) {
home.setHome(missionItem);
}
break;
default :
break;
}
super.onMavLinkMessageReceived(message);
}