Program: 8387
Project: 8387
Buggy source:
private void finallySaveClicked(){
  try {
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_SAVE_KEYRING);
    Bundle data=new Bundle();
    data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE,mCurrentPassphrase);
    data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE,mNewPassPhrase);
    data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS,getUserIds(mUserIdsView));
    ArrayList<PGPSecretKey> keys=getKeys(mKeysView);
    data.putByteArray(KeychainIntentService.SAVE_KEYRING_KEYS,PgpConversionHelper.PGPSecretKeyArrayListToBytes(keys));
    data.putIntegerArrayList(KeychainIntentService.SAVE_KEYRING_KEYS_USAGES,getKeysUsages(mKeysView));
    data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES,getKeysExpiryDates(mKeysView));
    data.putLong(KeychainIntentService.SAVE_KEYRING_MASTER_KEY_ID,getMasterKeyId());
    data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN,masterCanSign);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,R.string.progress_saving,ProgressDialog.STYLE_HORIZONTAL){
      public void handleMessage(      Message message){
        super.handleMessage(message);
        if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
          Intent data=new Intent();
          data.putExtra(RESULT_EXTRA_MASTER_KEY_ID,getMasterKeyId());
          ArrayList<String> userIds=null;
          try {
            userIds=getUserIds(mUserIdsView);
          }
 catch (          PgpGeneralException e) {
            Log.e(Constants.TAG,"String_Node_Str",e);
          }
          data.putExtra(RESULT_EXTRA_USER_ID,userIds.get(0));
          setResult(RESULT_OK,data);
          finish();
        }
      }
    }
;
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 catch (  PgpGeneralException e) {
  }
}

Fixed version (ground truth):
private void finallySaveClicked(){
  try {
    Intent intent=new Intent(this,KeychainIntentService.class);
    intent.setAction(KeychainIntentService.ACTION_SAVE_KEYRING);
    Bundle data=new Bundle();
    data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE,mCurrentPassphrase);
    data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE,mNewPassPhrase);
    data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS,getUserIds(mUserIdsView));
    ArrayList<PGPSecretKey> keys=getKeys(mKeysView);
    data.putByteArray(KeychainIntentService.SAVE_KEYRING_KEYS,PgpConversionHelper.PGPSecretKeyArrayListToBytes(keys));
    data.putIntegerArrayList(KeychainIntentService.SAVE_KEYRING_KEYS_USAGES,getKeysUsages(mKeysView));
    data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES,getKeysExpiryDates(mKeysView));
    data.putLong(KeychainIntentService.SAVE_KEYRING_MASTER_KEY_ID,getMasterKeyId());
    data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN,masterCanSign);
    intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
    KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,getString(R.string.progress_saving),ProgressDialog.STYLE_HORIZONTAL){
      public void handleMessage(      Message message){
        super.handleMessage(message);
        if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
          Intent data=new Intent();
          data.putExtra(RESULT_EXTRA_MASTER_KEY_ID,getMasterKeyId());
          ArrayList<String> userIds=null;
          try {
            userIds=getUserIds(mUserIdsView);
          }
 catch (          PgpGeneralException e) {
            Log.e(Constants.TAG,"String_Node_Str",e);
          }
          data.putExtra(RESULT_EXTRA_USER_ID,userIds.get(0));
          setResult(RESULT_OK,data);
          finish();
        }
      }
    }
;
    Messenger messenger=new Messenger(saveHandler);
    intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
    saveHandler.showProgressDialog(this);
    startService(intent);
  }
 catch (  PgpGeneralException e) {
  }
}