Program: 94800
Project: 94800
Buggy source:
@Override public void onMavLinkMessageReceived(MAVLinkMessage message){
  if (message.compid != AUTOPILOT_COMPONENT_ID) {
    return;
  }
  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;
  setType(msg_heart.type);
checkIfFlying(msg_heart);
processState(msg_heart);
ApmModes newMode=ApmModes.getMode(msg_heart.custom_mode,getType());
getState().setMode(newMode);
onHeartbeat(msg_heart);
break;
case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT:
msg_statustext msg_statustext=(msg_statustext)message;
processStatusText(msg_statustext);
break;
case msg_attitude.MAVLINK_MSG_ID_ATTITUDE:
msg_attitude m_att=(msg_attitude)message;
getOrientation().setRollPitchYaw(m_att.roll * 180.0 / Math.PI,m_att.pitch * 180.0 / Math.PI,m_att.yaw * 180.0 / Math.PI);
break;
case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD:
msg_vfr_hud m_hud=(msg_vfr_hud)message;
setAltitudeGroundAndAirSpeeds(m_hud.alt,m_hud.groundspeed,m_hud.airspeed,m_hud.climb);
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);
getNavigation().setNavPitchRollYaw(m_nav.nav_pitch,m_nav.nav_roll,m_nav.nav_bearing);
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:
getGps().setPosition(((msg_global_position_int)message).lat / 1E7,((msg_global_position_int)message).lon / 1E7);
break;
case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS:
msg_sys_status m_sys=(msg_sys_status)message;
getBattery().setBatteryState(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;
getRadio().setRadioState(m_radio.rxerrors,m_radio.fixed,m_radio.rssi,m_radio.remrssi,m_radio.txbuf,m_radio.noise,m_radio.remnoise);
break;
case msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS:
msg_radio_status m_radio_status=(msg_radio_status)message;
getRadio().setRadioState(m_radio_status.rxerrors,m_radio_status.fixed,m_radio_status.rssi,m_radio_status.remrssi,m_radio_status.txbuf,m_radio_status.noise,m_radio_status.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:
getRC().setRcInputValues((msg_rc_channels_raw)message);
break;
case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
getRC().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:
getCamera().updateMountOrientation(((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_ekf_status_report.MAVLINK_MSG_ID_EKF_STATUS_REPORT:
getState().setEkfStatus((msg_ekf_status_report)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) {
getHome().setHome(missionItem);
}
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onMavLinkMessageReceived(MAVLinkMessage message){
  if (message.compid != AUTOPILOT_COMPONENT_ID && message.compid != ARTOO_COMPONENT_ID) {
    return;
  }
  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;
  setType(msg_heart.type);
checkIfFlying(msg_heart);
processState(msg_heart);
ApmModes newMode=ApmModes.getMode(msg_heart.custom_mode,getType());
getState().setMode(newMode);
onHeartbeat(msg_heart);
break;
case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT:
msg_statustext msg_statustext=(msg_statustext)message;
processStatusText(msg_statustext);
break;
case msg_attitude.MAVLINK_MSG_ID_ATTITUDE:
msg_attitude m_att=(msg_attitude)message;
getOrientation().setRollPitchYaw(m_att.roll * 180.0 / Math.PI,m_att.pitch * 180.0 / Math.PI,m_att.yaw * 180.0 / Math.PI);
break;
case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD:
msg_vfr_hud m_hud=(msg_vfr_hud)message;
setAltitudeGroundAndAirSpeeds(m_hud.alt,m_hud.groundspeed,m_hud.airspeed,m_hud.climb);
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);
getNavigation().setNavPitchRollYaw(m_nav.nav_pitch,m_nav.nav_roll,m_nav.nav_bearing);
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:
getGps().setPosition(((msg_global_position_int)message).lat / 1E7,((msg_global_position_int)message).lon / 1E7);
break;
case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS:
msg_sys_status m_sys=(msg_sys_status)message;
getBattery().setBatteryState(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;
getRadio().setRadioState(m_radio.rxerrors,m_radio.fixed,m_radio.rssi,m_radio.remrssi,m_radio.txbuf,m_radio.noise,m_radio.remnoise);
break;
case msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS:
msg_radio_status m_radio_status=(msg_radio_status)message;
getRadio().setRadioState(m_radio_status.rxerrors,m_radio_status.fixed,m_radio_status.rssi,m_radio_status.remrssi,m_radio_status.txbuf,m_radio_status.noise,m_radio_status.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:
getRC().setRcInputValues((msg_rc_channels_raw)message);
break;
case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
getRC().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:
getCamera().updateMountOrientation(((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_ekf_status_report.MAVLINK_MSG_ID_EKF_STATUS_REPORT:
getState().setEkfStatus((msg_ekf_status_report)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) {
getHome().setHome(missionItem);
}
break;
default :
break;
}
}