Program: 8389
Project: 8389
Buggy source:
/** 
 * Import keys with mImportData
 */
public void importKeys(){
  if (mListFragment.getKeyBytes() != null || mListFragment.getDataUri() != null) {
    Log.d(Constants.TAG,"String_Node_Str");
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_IMPORT_KEYRING);
    Bundle data=new Bundle();
    ArrayList<ImportKeysListEntry> selectedEntries=mListFragment.getSelectedData();
    data.putParcelableArrayList(KeychainIntentService.IMPORT_KEY_LIST,selectedEntries);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 else   if (mListFragment.getServerQuery() != null) {
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_DOWNLOAD_AND_IMPORT_KEYS);
    Bundle data=new Bundle();
    data.putString(KeychainIntentService.DOWNLOAD_KEY_SERVER,mListFragment.getKeyServer());
    ArrayList<ImportKeysListEntry> selectedEntries=mListFragment.getSelectedData();
    data.putParcelableArrayList(KeychainIntentService.DOWNLOAD_KEY_LIST,selectedEntries);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 else {
    AppMsg.makeText(this,R.string.error_nothing_import,AppMsg.STYLE_ALERT).show();
  }
}

Fixed version (ground truth):
/** 
 * Import keys with mImportData
 */
public void importKeys(){
  KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,getString(R.string.progress_importing),ProgressDialog.STYLE_HORIZONTAL){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Bundle returnData=message.getData();
        int added=returnData.getInt(KeychainIntentService.RESULT_IMPORT_ADDED);
        int updated=returnData.getInt(KeychainIntentService.RESULT_IMPORT_UPDATED);
        int bad=returnData.getInt(KeychainIntentService.RESULT_IMPORT_BAD);
        String toastMessage;
        if (added > 0 && updated > 0) {
          String addedStr=getResources().getQuantityString(R.plurals.keys_added_and_updated_1,added,added);
          String updatedStr=getResources().getQuantityString(R.plurals.keys_added_and_updated_2,updated,updated);
          toastMessage=addedStr + updatedStr;
        }
 else         if (added > 0) {
          toastMessage=getResources().getQuantityString(R.plurals.keys_added,added,added);
        }
 else         if (updated > 0) {
          toastMessage=getResources().getQuantityString(R.plurals.keys_updated,updated,updated);
        }
 else {
          toastMessage=getString(R.string.no_keys_added_or_updated);
        }
        AppMsg.makeText(ImportKeysActivity.this,toastMessage,AppMsg.STYLE_INFO).show();
        if (bad > 0) {
          BadImportKeyDialogFragment badImportKeyDialogFragment=BadImportKeyDialogFragment.newInstance(bad);
          badImportKeyDialogFragment.show(getSupportFragmentManager(),"String_Node_Str");
        }
      }
    }
  }
;
  if (mListFragment.getKeyBytes() != null || mListFragment.getDataUri() != null) {
    Log.d(Constants.TAG,"String_Node_Str");
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_IMPORT_KEYRING);
    Bundle data=new Bundle();
    ArrayList<ImportKeysListEntry> selectedEntries=mListFragment.getSelectedData();
    data.putParcelableArrayList(KeychainIntentService.IMPORT_KEY_LIST,selectedEntries);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 else   if (mListFragment.getServerQuery() != null) {
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_DOWNLOAD_AND_IMPORT_KEYS);
    Bundle data=new Bundle();
    data.putString(KeychainIntentService.DOWNLOAD_KEY_SERVER,mListFragment.getKeyServer());
    ArrayList<ImportKeysListEntry> selectedEntries=mListFragment.getSelectedData();
    data.putParcelableArrayList(KeychainIntentService.DOWNLOAD_KEY_LIST,selectedEntries);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 else {
    AppMsg.makeText(this,R.string.error_nothing_import,AppMsg.STYLE_ALERT).show();
  }
}