Program: 8380
Project: 8380
Buggy source:
/** 
 * Export keys
 */
public void exportKeys(Uri dataUri,int keyType){
  Log.d(Constants.TAG,"String_Node_Str");
  Intent intent=new Intent(activity,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_EXPORT_KEYRING);
  Bundle data=new Bundle();
  data.putString(KeychainIntentService.EXPORT_FILENAME,mExportFilename);
  data.putInt(KeychainIntentService.EXPORT_KEY_TYPE,keyType);
  if (dataUri == null) {
    data.putBoolean(KeychainIntentService.EXPORT_ALL,true);
  }
 else {
    long keyRingMasterKeyId=ProviderHelper.getMasterKeyId(activity,dataUri);
    data.putLong(KeychainIntentService.EXPORT_KEY_RING_MASTER_KEY_ID,keyRingMasterKeyId);
  }
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler exportHandler=new KeychainIntentServiceHandler(activity,R.string.progress_exporting,ProgressDialog.STYLE_HORIZONTAL){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Bundle returnData=message.getData();
        int exported=returnData.getInt(KeychainIntentService.RESULT_EXPORT);
        String toastMessage;
        if (exported == 1) {
          toastMessage=activity.getString(R.string.key_exported);
        }
 else         if (exported > 0) {
          toastMessage=activity.getString(R.string.keys_exported,exported);
        }
 else {
          toastMessage=activity.getString(R.string.no_keys_exported);
        }
        Toast.makeText(activity,toastMessage,Toast.LENGTH_SHORT).show();
      }
    }
  }
;
  Messenger messenger=new Messenger(exportHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  exportHandler.showProgressDialog(activity);
  activity.startService(intent);
}

Fixed version (ground truth):
/** 
 * Export keys
 */
public void exportKeys(Uri dataUri,int keyType){
  Log.d(Constants.TAG,"String_Node_Str");
  Intent intent=new Intent(activity,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_EXPORT_KEYRING);
  Bundle data=new Bundle();
  data.putString(KeychainIntentService.EXPORT_FILENAME,mExportFilename);
  data.putInt(KeychainIntentService.EXPORT_KEY_TYPE,keyType);
  if (dataUri == null) {
    data.putBoolean(KeychainIntentService.EXPORT_ALL,true);
  }
 else {
    long keyRingMasterKeyId=ProviderHelper.getMasterKeyId(activity,dataUri);
    data.putLong(KeychainIntentService.EXPORT_KEY_RING_MASTER_KEY_ID,keyRingMasterKeyId);
  }
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler exportHandler=new KeychainIntentServiceHandler(activity,activity.getString(R.string.progress_exporting),ProgressDialog.STYLE_HORIZONTAL){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Bundle returnData=message.getData();
        int exported=returnData.getInt(KeychainIntentService.RESULT_EXPORT);
        String toastMessage;
        if (exported == 1) {
          toastMessage=activity.getString(R.string.key_exported);
        }
 else         if (exported > 0) {
          toastMessage=activity.getString(R.string.keys_exported,exported);
        }
 else {
          toastMessage=activity.getString(R.string.no_keys_exported);
        }
        Toast.makeText(activity,toastMessage,Toast.LENGTH_SHORT).show();
      }
    }
  }
;
  Messenger messenger=new Messenger(exportHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  exportHandler.showProgressDialog(activity);
  activity.startService(intent);
}