Program: 94913
Project: 94913
Buggy source:
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
  Bundle extrasBundle=null;
  String droneEvent=null;
  final List<Pair<String,Bundle>> attributesInfo=new ArrayList<>();
switch (event) {
case DISCONNECTED:
    context.sendBroadcast(new Intent(GCSEvent.ACTION_VEHICLE_DISCONNECTION).putExtra(GCSEvent.EXTRA_APP_ID,ownerId));
  droneEvent=AttributeEvent.STATE_DISCONNECTED;
break;
case GUIDEDPOINT:
droneEvent=AttributeEvent.GUIDED_POINT_UPDATED;
break;
case RADIO:
droneEvent=AttributeEvent.SIGNAL_UPDATED;
break;
case RC_IN:
break;
case RC_OUT:
break;
case ARMING_STARTED:
case ARMING:
droneEvent=AttributeEvent.STATE_ARMING;
break;
case AUTOPILOT_WARNING:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.ERROR);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,drone.getState().getWarning());
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case MODE:
droneEvent=AttributeEvent.STATE_VEHICLE_MODE;
break;
case NAVIGATION:
case ATTITUDE:
case ORIENTATION:
droneEvent=AttributeEvent.ATTITUDE_UPDATED;
break;
case SPEED:
droneEvent=AttributeEvent.SPEED_UPDATED;
break;
case BATTERY:
droneEvent=AttributeEvent.BATTERY_UPDATED;
break;
case STATE:
droneEvent=AttributeEvent.STATE_UPDATED;
break;
case MISSION_UPDATE:
droneEvent=AttributeEvent.MISSION_UPDATED;
break;
case MISSION_RECEIVED:
droneEvent=AttributeEvent.MISSION_RECEIVED;
break;
case FIRMWARE:
case TYPE:
droneEvent=AttributeEvent.TYPE_UPDATED;
break;
case HOME:
droneEvent=AttributeEvent.HOME_UPDATED;
break;
case GPS:
droneEvent=AttributeEvent.GPS_POSITION;
break;
case GPS_FIX:
droneEvent=AttributeEvent.GPS_FIX;
break;
case GPS_COUNT:
droneEvent=AttributeEvent.GPS_COUNT;
break;
case PARAMETER:
case PARAMETERS_DOWNLOADED:
droneEvent=AttributeEvent.PARAMETERS_RECEIVED;
break;
case CALIBRATION_IMU:
if (droneMgr != null) {
final String calIMUMessage=this.droneMgr.getDrone().getCalibrationSetup().getMessage();
extrasBundle=new Bundle(1);
extrasBundle.putString(AttributeEventExtra.EXTRA_CALIBRATION_IMU_MESSAGE,calIMUMessage);
}
droneEvent=AttributeEvent.CALIBRATION_IMU;
break;
case CALIBRATION_TIMEOUT:
if (droneMgr != null) {
final Calibration calibration=this.droneMgr.getDrone().getCalibrationSetup();
final String message=calibration.getMessage();
if (calibration.isCalibrating() && TextUtils.isEmpty(message)) {
calibration.setCalibrating(false);
droneEvent=AttributeEvent.HEARTBEAT_TIMEOUT;
}
 else {
extrasBundle=new Bundle(1);
extrasBundle.putString(AttributeEventExtra.EXTRA_CALIBRATION_IMU_MESSAGE,message);
droneEvent=AttributeEvent.CALIBRATION_IMU_TIMEOUT;
}
}
 else {
droneEvent=AttributeEvent.CALIBRATION_IMU_TIMEOUT;
}
break;
case HEARTBEAT_TIMEOUT:
droneEvent=AttributeEvent.HEARTBEAT_TIMEOUT;
break;
case CONNECTING:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.INFO);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,"String_Node_Str");
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case CHECKING_VEHICLE_LINK:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.INFO);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,"String_Node_Str");
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case CONNECTION_FAILED:
onConnectionFailed("String_Node_Str");
break;
case HEARTBEAT_FIRST:
if (droneMgr != null) {
final Bundle heartBeatExtras=new Bundle(1);
heartBeatExtras.putInt(AttributeEventExtra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
attributesInfo.add(Pair.create(AttributeEvent.HEARTBEAT_FIRST,heartBeatExtras));
}
case CONNECTED:
if (droneMgr != null) {
final ConnectionParameter sanitizedParameter=new ConnectionParameter(connectionParams.getConnectionType(),connectionParams.getParamsBundle(),null);
context.sendBroadcast(new Intent(GCSEvent.ACTION_VEHICLE_CONNECTION).putExtra(GCSEvent.EXTRA_APP_ID,ownerId).putExtra(GCSEvent.EXTRA_VEHICLE_CONNECTION_PARAMETER,sanitizedParameter));
attributesInfo.add(Pair.<String,Bundle>create(AttributeEvent.STATE_CONNECTED,null));
}
break;
case HEARTBEAT_RESTORED:
extrasBundle=new Bundle(1);
extrasBundle.putInt(AttributeEventExtra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
droneEvent=AttributeEvent.HEARTBEAT_RESTORED;
break;
case MISSION_SENT:
droneEvent=AttributeEvent.MISSION_SENT;
break;
case INVALID_POLYGON:
break;
case MISSION_WP_UPDATE:
if (droneMgr != null) {
final int currentWaypoint=this.droneMgr.getDrone().getMissionStats().getCurrentWP();
extrasBundle=new Bundle(1);
extrasBundle.putInt(AttributeEventExtra.EXTRA_MISSION_CURRENT_WAYPOINT,currentWaypoint);
droneEvent=AttributeEvent.MISSION_ITEM_UPDATED;
}
break;
case FOLLOW_START:
droneEvent=AttributeEvent.FOLLOW_START;
break;
case FOLLOW_STOP:
droneEvent=AttributeEvent.FOLLOW_STOP;
break;
case FOLLOW_UPDATE:
case FOLLOW_CHANGE_TYPE:
droneEvent=AttributeEvent.FOLLOW_UPDATE;
break;
case WARNING_400FT_EXCEEDED:
droneEvent=AttributeEvent.ALTITUDE_400FT_EXCEEDED;
break;
case WARNING_SIGNAL_WEAK:
droneEvent=AttributeEvent.SIGNAL_WEAK;
break;
case WARNING_NO_GPS:
droneEvent=AttributeEvent.WARNING_NO_GPS;
break;
case MAGNETOMETER:
break;
case FOOTPRINT:
droneEvent=AttributeEvent.CAMERA_FOOTPRINTS_UPDATED;
break;
}
if (droneEvent != null) {
notifyAttributeUpdate(droneEvent,extrasBundle);
}
if (!attributesInfo.isEmpty()) {
notifyAttributeUpdate(attributesInfo);
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
  Bundle extrasBundle=null;
  String droneEvent=null;
  final List<Pair<String,Bundle>> attributesInfo=new ArrayList<>();
switch (event) {
case DISCONNECTED:
    context.sendBroadcast(new Intent(GCSEvent.ACTION_VEHICLE_DISCONNECTION).putExtra(GCSEvent.EXTRA_APP_ID,ownerId));
  droneEvent=AttributeEvent.STATE_DISCONNECTED;
break;
case GUIDEDPOINT:
droneEvent=AttributeEvent.GUIDED_POINT_UPDATED;
break;
case RADIO:
droneEvent=AttributeEvent.SIGNAL_UPDATED;
break;
case RC_IN:
break;
case RC_OUT:
break;
case ARMING_STARTED:
case ARMING:
droneEvent=AttributeEvent.STATE_ARMING;
break;
case AUTOPILOT_WARNING:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.ERROR);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,drone.getState().getWarning());
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case MODE:
droneEvent=AttributeEvent.STATE_VEHICLE_MODE;
break;
case NAVIGATION:
case ATTITUDE:
case ORIENTATION:
droneEvent=AttributeEvent.ATTITUDE_UPDATED;
break;
case SPEED:
droneEvent=AttributeEvent.SPEED_UPDATED;
break;
case BATTERY:
droneEvent=AttributeEvent.BATTERY_UPDATED;
break;
case STATE:
droneEvent=AttributeEvent.STATE_UPDATED;
break;
case MISSION_UPDATE:
droneEvent=AttributeEvent.MISSION_UPDATED;
break;
case MISSION_RECEIVED:
droneEvent=AttributeEvent.MISSION_RECEIVED;
break;
case FIRMWARE:
case TYPE:
droneEvent=AttributeEvent.TYPE_UPDATED;
break;
case HOME:
droneEvent=AttributeEvent.HOME_UPDATED;
break;
case GPS:
droneEvent=AttributeEvent.GPS_POSITION;
break;
case GPS_FIX:
droneEvent=AttributeEvent.GPS_FIX;
break;
case GPS_COUNT:
droneEvent=AttributeEvent.GPS_COUNT;
break;
case PARAMETER:
case PARAMETERS_DOWNLOADED:
droneEvent=AttributeEvent.PARAMETERS_RECEIVED;
break;
case CALIBRATION_IMU:
final String calIMUMessage=drone.getCalibrationSetup().getMessage();
extrasBundle=new Bundle(1);
extrasBundle.putString(AttributeEventExtra.EXTRA_CALIBRATION_IMU_MESSAGE,calIMUMessage);
droneEvent=AttributeEvent.CALIBRATION_IMU;
break;
case CALIBRATION_TIMEOUT:
final Calibration calibration=drone.getCalibrationSetup();
final String message=calibration.getMessage();
if (calibration.isCalibrating() && TextUtils.isEmpty(message)) {
calibration.setCalibrating(false);
droneEvent=AttributeEvent.HEARTBEAT_TIMEOUT;
}
 else {
extrasBundle=new Bundle(1);
extrasBundle.putString(AttributeEventExtra.EXTRA_CALIBRATION_IMU_MESSAGE,message);
droneEvent=AttributeEvent.CALIBRATION_IMU_TIMEOUT;
}
break;
case HEARTBEAT_TIMEOUT:
droneEvent=AttributeEvent.HEARTBEAT_TIMEOUT;
break;
case CONNECTING:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.INFO);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,"String_Node_Str");
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case CHECKING_VEHICLE_LINK:
extrasBundle=new Bundle(2);
extrasBundle.putInt(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE_LEVEL,Log.INFO);
extrasBundle.putString(AttributeEventExtra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,"String_Node_Str");
droneEvent=AttributeEvent.AUTOPILOT_FAILSAFE;
break;
case CONNECTION_FAILED:
onConnectionFailed("String_Node_Str");
break;
case HEARTBEAT_FIRST:
final Bundle heartBeatExtras=new Bundle(1);
heartBeatExtras.putInt(AttributeEventExtra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
attributesInfo.add(Pair.create(AttributeEvent.HEARTBEAT_FIRST,heartBeatExtras));
case CONNECTED:
final ConnectionParameter sanitizedParameter=new ConnectionParameter(connectionParams.getConnectionType(),connectionParams.getParamsBundle(),null);
context.sendBroadcast(new Intent(GCSEvent.ACTION_VEHICLE_CONNECTION).putExtra(GCSEvent.EXTRA_APP_ID,ownerId).putExtra(GCSEvent.EXTRA_VEHICLE_CONNECTION_PARAMETER,sanitizedParameter));
attributesInfo.add(Pair.<String,Bundle>create(AttributeEvent.STATE_CONNECTED,null));
break;
case HEARTBEAT_RESTORED:
extrasBundle=new Bundle(1);
extrasBundle.putInt(AttributeEventExtra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
droneEvent=AttributeEvent.HEARTBEAT_RESTORED;
break;
case MISSION_SENT:
droneEvent=AttributeEvent.MISSION_SENT;
break;
case INVALID_POLYGON:
break;
case MISSION_WP_UPDATE:
final int currentWaypoint=drone.getMissionStats().getCurrentWP();
extrasBundle=new Bundle(1);
extrasBundle.putInt(AttributeEventExtra.EXTRA_MISSION_CURRENT_WAYPOINT,currentWaypoint);
droneEvent=AttributeEvent.MISSION_ITEM_UPDATED;
break;
case FOLLOW_START:
droneEvent=AttributeEvent.FOLLOW_START;
break;
case FOLLOW_STOP:
droneEvent=AttributeEvent.FOLLOW_STOP;
break;
case FOLLOW_UPDATE:
case FOLLOW_CHANGE_TYPE:
droneEvent=AttributeEvent.FOLLOW_UPDATE;
break;
case WARNING_400FT_EXCEEDED:
droneEvent=AttributeEvent.ALTITUDE_400FT_EXCEEDED;
break;
case WARNING_SIGNAL_WEAK:
droneEvent=AttributeEvent.SIGNAL_WEAK;
break;
case WARNING_NO_GPS:
droneEvent=AttributeEvent.WARNING_NO_GPS;
break;
case MAGNETOMETER:
break;
case FOOTPRINT:
droneEvent=AttributeEvent.CAMERA_FOOTPRINTS_UPDATED;
break;
}
if (droneEvent != null) {
notifyAttributeUpdate(droneEvent,extrasBundle);
}
if (!attributesInfo.isEmpty()) {
notifyAttributeUpdate(attributesInfo);
}
}