Program: 94799
Project: 94799
Buggy source:
@Override public void executeAsyncAction(Action action,final ICommandListener listener){
  final String type=action.getType();
  Bundle data=action.getData();
switch (type) {
case MissionActions.ACTION_GENERATE_DRONIE:
    final float bearing=CommonApiUtils.generateDronie(drone);
  if (bearing != -1) {
    Bundle bundle=new Bundle(1);
    bundle.putFloat(AttributeEventExtra.EXTRA_MISSION_DRONIE_BEARING,bearing);
    notifyDroneAttributeEvent(AttributeEvent.MISSION_DRONIE_CREATED,bundle);
  }
break;
case MissionActions.ACTION_BUILD_COMPLEX_MISSION_ITEM:
CommonApiUtils.buildComplexMissionItem(drone,data);
break;
case FollowMeActions.ACTION_ENABLE_FOLLOW_ME:
data.setClassLoader(FollowType.class.getClassLoader());
FollowType followType=data.getParcelable(FollowMeActions.EXTRA_FOLLOW_TYPE);
CommonApiUtils.enableFollowMe(this,handler,followType);
break;
case FollowMeActions.ACTION_UPDATE_FOLLOW_PARAMS:
if (followMe != null) {
data.setClassLoader(LatLong.class.getClassLoader());
final FollowAlgorithm followAlgorithm=followMe.getFollowAlgorithm();
if (followAlgorithm != null) {
Map<String,Object> paramsMap=new HashMap<>();
Set<String> dataKeys=data.keySet();
for (String key : dataKeys) {
if (FollowType.EXTRA_FOLLOW_ROI_TARGET.equals(key)) {
LatLong target=data.getParcelable(key);
if (target != null) {
final Coord2D roiTarget;
if (target instanceof LatLongAlt) {
roiTarget=new Coord3D(target.getLatitude(),target.getLongitude(),((LatLongAlt)target).getAltitude());
}
 else {
roiTarget=new Coord2D(target.getLatitude(),target.getLongitude());
}
paramsMap.put(key,roiTarget);
}
}
 else paramsMap.put(key,data.get(key));
}
followAlgorithm.updateAlgorithmParams(paramsMap);
}
}
break;
case FollowMeActions.ACTION_DISABLE_FOLLOW_ME:
CommonApiUtils.disableFollowMe(followMe);
break;
case SoloLinkActions.ACTION_SEND_MESSAGE:
final TLVPacket messageData=data.getParcelable(SoloLinkActions.EXTRA_MESSAGE_DATA);
if (messageData != null) {
SoloLinkApiUtils.sendSoloLinkMessage(this,messageData,listener);
}
break;
case SoloLinkActions.ACTION_UPDATE_WIFI_SETTINGS:
final String wifiSsid=data.getString(SoloLinkActions.EXTRA_WIFI_SSID);
final String wifiPassword=data.getString(SoloLinkActions.EXTRA_WIFI_PASSWORD);
SoloLinkApiUtils.updateSoloLinkWifiSettings(this,wifiSsid,wifiPassword,listener);
break;
case SoloLinkActions.ACTION_UPDATE_BUTTON_SETTINGS:
final SoloButtonSettingSetter buttonSettings=data.getParcelable(SoloLinkActions.EXTRA_BUTTON_SETTINGS);
if (buttonSettings != null) {
SoloLinkApiUtils.updateSoloLinkButtonSettings(this,buttonSettings,listener);
}
break;
case SoloLinkActions.ACTION_UPDATE_CONTROLLER_MODE:
final @SoloControllerMode.ControllerMode int mode=data.getInt(SoloLinkActions.EXTRA_CONTROLLER_MODE);
SoloLinkApiUtils.updateSoloLinkControllerMode(this,mode,listener);
break;
case SoloLinkActions.ACTION_UPDATE_EU_TX_POWER_COMPLIANCE:
final boolean isCompliant=data.getBoolean(SoloLinkActions.EXTRA_EU_TX_POWER_COMPLIANT,false);
SoloLinkApiUtils.updateSoloLinkEUTxPowerCompliance(this,isCompliant,listener);
break;
case CapabilityActions.ACTION_CHECK_FEATURE_SUPPORT:
if (listener != null) {
final String featureId=data.getString(CapabilityActions.EXTRA_FEATURE_ID);
if (!TextUtils.isEmpty(featureId)) {
switch (featureId) {
case CapabilityApi.FeatureIds.SOLOLINK_VIDEO_STREAMING:
case CapabilityApi.FeatureIds.COMPASS_CALIBRATION:
if (this.isCompanionComputerEnabled()) {
CommonApiUtils.postSuccessEvent(listener);
}
 else {
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_UNSUPPORTED,listener);
}
break;
default :
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_UNSUPPORTED,listener);
break;
}
}
}
break;
default :
if (drone != null) {
drone.executeAsyncAction(action,listener);
}
 else {
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_FAILED,listener);
}
break;
}
}

Fixed version (ground truth):
@Override public void executeAsyncAction(Action action,final ICommandListener listener){
  final String type=action.getType();
  Bundle data=action.getData();
switch (type) {
case MissionActions.ACTION_GENERATE_DRONIE:
    final float bearing=CommonApiUtils.generateDronie(drone);
  if (bearing != -1) {
    Bundle bundle=new Bundle(1);
    bundle.putFloat(AttributeEventExtra.EXTRA_MISSION_DRONIE_BEARING,bearing);
    notifyDroneAttributeEvent(AttributeEvent.MISSION_DRONIE_CREATED,bundle);
  }
break;
case FollowMeActions.ACTION_ENABLE_FOLLOW_ME:
data.setClassLoader(FollowType.class.getClassLoader());
FollowType followType=data.getParcelable(FollowMeActions.EXTRA_FOLLOW_TYPE);
CommonApiUtils.enableFollowMe(this,handler,followType);
break;
case FollowMeActions.ACTION_UPDATE_FOLLOW_PARAMS:
if (followMe != null) {
data.setClassLoader(LatLong.class.getClassLoader());
final FollowAlgorithm followAlgorithm=followMe.getFollowAlgorithm();
if (followAlgorithm != null) {
Map<String,Object> paramsMap=new HashMap<>();
Set<String> dataKeys=data.keySet();
for (String key : dataKeys) {
if (FollowType.EXTRA_FOLLOW_ROI_TARGET.equals(key)) {
LatLong target=data.getParcelable(key);
if (target != null) {
final Coord2D roiTarget;
if (target instanceof LatLongAlt) {
  roiTarget=new Coord3D(target.getLatitude(),target.getLongitude(),((LatLongAlt)target).getAltitude());
}
 else {
  roiTarget=new Coord2D(target.getLatitude(),target.getLongitude());
}
paramsMap.put(key,roiTarget);
}
}
 else paramsMap.put(key,data.get(key));
}
followAlgorithm.updateAlgorithmParams(paramsMap);
}
}
break;
case FollowMeActions.ACTION_DISABLE_FOLLOW_ME:
CommonApiUtils.disableFollowMe(followMe);
break;
case SoloLinkActions.ACTION_SEND_MESSAGE:
final TLVPacket messageData=data.getParcelable(SoloLinkActions.EXTRA_MESSAGE_DATA);
if (messageData != null) {
SoloLinkApiUtils.sendSoloLinkMessage(this,messageData,listener);
}
break;
case SoloLinkActions.ACTION_UPDATE_WIFI_SETTINGS:
final String wifiSsid=data.getString(SoloLinkActions.EXTRA_WIFI_SSID);
final String wifiPassword=data.getString(SoloLinkActions.EXTRA_WIFI_PASSWORD);
SoloLinkApiUtils.updateSoloLinkWifiSettings(this,wifiSsid,wifiPassword,listener);
break;
case SoloLinkActions.ACTION_UPDATE_BUTTON_SETTINGS:
final SoloButtonSettingSetter buttonSettings=data.getParcelable(SoloLinkActions.EXTRA_BUTTON_SETTINGS);
if (buttonSettings != null) {
SoloLinkApiUtils.updateSoloLinkButtonSettings(this,buttonSettings,listener);
}
break;
case SoloLinkActions.ACTION_UPDATE_CONTROLLER_MODE:
final @SoloControllerMode.ControllerMode int mode=data.getInt(SoloLinkActions.EXTRA_CONTROLLER_MODE);
SoloLinkApiUtils.updateSoloLinkControllerMode(this,mode,listener);
break;
case SoloLinkActions.ACTION_UPDATE_EU_TX_POWER_COMPLIANCE:
final boolean isCompliant=data.getBoolean(SoloLinkActions.EXTRA_EU_TX_POWER_COMPLIANT,false);
SoloLinkApiUtils.updateSoloLinkEUTxPowerCompliance(this,isCompliant,listener);
break;
case CapabilityActions.ACTION_CHECK_FEATURE_SUPPORT:
if (listener != null) {
final String featureId=data.getString(CapabilityActions.EXTRA_FEATURE_ID);
if (!TextUtils.isEmpty(featureId)) {
switch (featureId) {
case CapabilityApi.FeatureIds.SOLOLINK_VIDEO_STREAMING:
case CapabilityApi.FeatureIds.COMPASS_CALIBRATION:
if (this.isCompanionComputerEnabled()) {
CommonApiUtils.postSuccessEvent(listener);
}
 else {
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_UNSUPPORTED,listener);
}
break;
default :
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_UNSUPPORTED,listener);
break;
}
}
}
break;
default :
if (drone != null) {
drone.executeAsyncAction(action,listener);
}
 else {
CommonApiUtils.postErrorEvent(CommandExecutionError.COMMAND_FAILED,listener);
}
break;
}
}