nus-yam/ex-repair huggingface dataset:
Program: 8368
Project: 8368
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.import_keys_activity);
  mViewPager=(ViewPager)findViewById(R.id.import_pager);
  mSlidingTabLayout=(SlidingTabLayout)findViewById(R.id.import_sliding_tab_layout);
  mImportButton=findViewById(R.id.import_import);
  mImportButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      importKeys();
    }
  }
);
  mNavigationStrings=getResources().getStringArray(R.array.import_action_list);
  handleActions(savedInstanceState,getIntent());
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.import_keys_activity);
  mViewPager=(ViewPager)findViewById(R.id.import_pager);
  mSlidingTabLayout=(SlidingTabLayout)findViewById(R.id.import_sliding_tab_layout);
  mImportButton=findViewById(R.id.import_import);
  mImportButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      importKeys();
    }
  }
);
  handleActions(savedInstanceState,getIntent());
}
Program: 8369
Project: 8369
Buggy source:
/** 
 * Scroll ViewPager left and right
 * @param event
 * @return
 */
@Override public boolean onTouchEvent(MotionEvent event){
  boolean result=super.onTouchEvent(event);
  if (!result) {
    mViewPager.onTouchEvent(event);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Scroll ViewPager left and right
 * @param event
 * @return
 */
@Override public boolean onTouchEvent(MotionEvent event){
  boolean result=super.onTouchEvent(event);
  if (!result) {
    try {
      mViewPager.onTouchEvent(event);
    }
 catch (    IllegalArgumentException e) {
      Log.d(Constants.TAG,"String_Node_Str");
    }
  }
  return result;
}
Program: 8371
Project: 8371
Buggy source:
private JSONObject getFromKeybase(String path,String query) throws QueryFailedException {
  try {
    String url="String_Node_Str" + path + URLEncoder.encode(query,"String_Node_Str");
    Log.d(Constants.TAG,"String_Node_Str" + url);
    URL realUrl=new URL(url);
    HttpURLConnection conn=(HttpURLConnection)realUrl.openConnection();
    conn.setConnectTimeout(5000);
    conn.setReadTimeout(25000);
    conn.connect();
    int response=conn.getResponseCode();
    if (response >= 200 && response < 300) {
      String text=readAll(conn.getInputStream(),conn.getContentEncoding());
      try {
        JSONObject json=new JSONObject(text);
        if (JWalk.getInt(json,"String_Node_Str","String_Node_Str") != 0) {
          throw new QueryFailedException("String_Node_Str");
        }
        return json;
      }
 catch (      JSONException e) {
        throw new QueryFailedException("String_Node_Str");
      }
    }
 else {
      String message=readAll(conn.getErrorStream(),conn.getContentEncoding());
      throw new QueryFailedException("String_Node_Str" + response + "String_Node_Str"+ message);
    }
  }
 catch (  Exception e) {
    throw new QueryFailedException("String_Node_Str");
  }
}

Fixed version (ground truth):
private JSONObject getFromKeybase(String path,String query) throws QueryFailedException {
  try {
    String url="String_Node_Str" + path + URLEncoder.encode(query,"String_Node_Str");
    Log.d(Constants.TAG,"String_Node_Str" + url);
    URL realUrl=new URL(url);
    HttpURLConnection conn=(HttpURLConnection)realUrl.openConnection();
    conn.setConnectTimeout(5000);
    conn.setReadTimeout(25000);
    conn.connect();
    int response=conn.getResponseCode();
    if (response >= 200 && response < 300) {
      String text=readAll(conn.getInputStream(),conn.getContentEncoding());
      try {
        JSONObject json=new JSONObject(text);
        if (JWalk.getInt(json,"String_Node_Str","String_Node_Str") != 0) {
          throw new QueryFailedException("String_Node_Str" + path + "String_Node_Str"+ query);
        }
        return json;
      }
 catch (      JSONException e) {
        throw new QueryFailedException("String_Node_Str");
      }
    }
 else {
      String message=readAll(conn.getErrorStream(),conn.getContentEncoding());
      throw new QueryFailedException("String_Node_Str" + response + "String_Node_Str"+ message);
    }
  }
 catch (  Exception e) {
    throw new QueryFailedException("String_Node_Str");
  }
}
Program: 8372
Project: 8372
Buggy source:
private LongSparseArray<UncachedPublicKey> getUncachedMasterKeys(Uri queryUri){
  Cursor cursor=mContentResolver.query(queryUri,new String[]{KeyRingData.MASTER_KEY_ID,KeyRingData.KEY_RING_DATA},null,null,null);
  LongSparseArray<UncachedPublicKey> result=new LongSparseArray<UncachedPublicKey>(cursor.getCount());
  try {
    if (cursor != null && cursor.moveToFirst())     do {
      long masterKeyId=cursor.getLong(0);
      byte[] data=cursor.getBlob(1);
      if (data != null) {
        try {
          result.put(masterKeyId,UncachedKeyRing.decodePublicFromData(data).getPublicKey());
        }
 catch (        PgpGeneralException e) {
          Log.e(Constants.TAG,"String_Node_Str");
        }
catch (        IOException e) {
          Log.e(Constants.TAG,"String_Node_Str");
        }
      }
    }
 while (cursor.moveToNext());
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return result;
}

Fixed version (ground truth):
private LongSparseArray<UncachedPublicKey> getUncachedMasterKeys(Uri queryUri){
  Cursor cursor=mContentResolver.query(queryUri,new String[]{KeyRingData.MASTER_KEY_ID,KeyRingData.KEY_RING_DATA},null,null,null);
  LongSparseArray<UncachedPublicKey> result=new LongSparseArray<UncachedPublicKey>(cursor.getCount());
  try {
    if (cursor != null && cursor.moveToFirst())     do {
      long masterKeyId=cursor.getLong(0);
      byte[] data=cursor.getBlob(1);
      if (data != null) {
        try {
          result.put(masterKeyId,UncachedKeyRing.decodeFromData(data).getPublicKey());
        }
 catch (        PgpGeneralException e) {
          Log.e(Constants.TAG,"String_Node_Str" + masterKeyId,e);
        }
catch (        IOException e) {
          Log.e(Constants.TAG,"String_Node_Str" + masterKeyId,e);
        }
      }
    }
 while (cursor.moveToNext());
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return result;
}
Program: 8375
Project: 8375
Buggy source:
private HashMap<String,String> getProjectionMapForUserIds(){
  HashMap<String,String> projectionMap=new HashMap<String,String>();
  projectionMap.put(BaseColumns._ID,Tables.USER_IDS + "String_Node_Str" + BaseColumns._ID);
  projectionMap.put(UserIdsColumns.USER_ID,Tables.USER_IDS + "String_Node_Str" + UserIdsColumns.USER_ID);
  projectionMap.put(UserIdsColumns.RANK,Tables.USER_IDS + "String_Node_Str" + UserIdsColumns.RANK);
  projectionMap.put(KeyRingsColumns.MASTER_KEY_ID,Tables.KEY_RINGS + "String_Node_Str" + KeyRingsColumns.MASTER_KEY_ID);
  return projectionMap;
}

Fixed version (ground truth):
private HashMap<String,String> getProjectionMapForUserIds(){
  HashMap<String,String> projectionMap=new HashMap<String,String>();
  projectionMap.put(BaseColumns._ID,Tables.USER_IDS + "String_Node_Str" + BaseColumns._ID);
  projectionMap.put(UserIdsColumns.USER_ID,Tables.USER_IDS + "String_Node_Str" + UserIdsColumns.USER_ID);
  projectionMap.put(UserIdsColumns.RANK,Tables.USER_IDS + "String_Node_Str" + UserIdsColumns.RANK);
  projectionMap.put(KeyRingsColumns.MASTER_KEY_ID,Tables.KEY_RINGS + "String_Node_Str" + KeyRingsColumns.MASTER_KEY_ID);
  projectionMap.put("String_Node_Str","String_Node_Str" + Tables.KEYS + "String_Node_Str"+ Keys._ID+ "String_Node_Str");
  return projectionMap;
}
Program: 8376
Project: 8376
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  setContentView(R.layout.view_cert_activity);
  mSigneeKey=(TextView)findViewById(R.id.signee_key);
  mSigneeUid=(TextView)findViewById(R.id.signee_uid);
  mRank=(TextView)findViewById(R.id.subkey_rank);
  mAlgorithm=(TextView)findViewById(R.id.algorithm);
  mType=(TextView)findViewById(R.id.signature_type);
  mCreation=(TextView)findViewById(R.id.creation);
  mExpiry=(TextView)findViewById(R.id.expiry);
  mSignerKey=(TextView)findViewById(R.id.signer_key_id);
  mSignerUid=(TextView)findViewById(R.id.signer_uid);
  mDataUri=getIntent().getData();
  if (mDataUri == null) {
    Log.e(Constants.TAG,"String_Node_Str");
    finish();
    return;
  }
  getSupportLoaderManager().initLoader(0,null,this);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  setContentView(R.layout.view_cert_activity);
  mSigneeKey=(TextView)findViewById(R.id.signee_key);
  mSigneeUid=(TextView)findViewById(R.id.signee_uid);
  mAlgorithm=(TextView)findViewById(R.id.algorithm);
  mType=(TextView)findViewById(R.id.signature_type);
  mCreation=(TextView)findViewById(R.id.creation);
  mExpiry=(TextView)findViewById(R.id.expiry);
  mSignerKey=(TextView)findViewById(R.id.signer_key_id);
  mSignerUid=(TextView)findViewById(R.id.signer_uid);
  mDataUri=getIntent().getData();
  if (mDataUri == null) {
    Log.e(Constants.TAG,"String_Node_Str");
    finish();
    return;
  }
  getSupportLoaderManager().initLoader(0,null,this);
}
Program: 8379
Project: 8379
Buggy source:
/** 
 * Query keyserver
 */
private void queryServer(String query,String keyServer){
  HkpKeyServer server=new HkpKeyServer(keyServer);
  try {
    ArrayList<ImportKeysListEntry> searchResult=server.search(query);
    mEntryList.addAll(searchResult);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,null);
  }
 catch (  KeyServer.InsufficientQuery e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
catch (  KeyServer.QueryException e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
catch (  KeyServer.TooManyResponses e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
}

Fixed version (ground truth):
/** 
 * Query keyserver
 */
private void queryServer(String query,String keyServer){
  HkpKeyServer server=new HkpKeyServer(keyServer);
  try {
    ArrayList<ImportKeysListEntry> searchResult=server.search(query);
    mEntryList.clear();
    mEntryList.addAll(searchResult);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,null);
  }
 catch (  KeyServer.InsufficientQuery e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
catch (  KeyServer.QueryException e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
catch (  KeyServer.TooManyResponses e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
    mEntryListWrapper=new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList,e);
  }
}
Program: 8381
Project: 8381
Buggy source:
public KeychainIntentServiceHandler(Activity activity,int progressDialogMessageId,int progressDialogStyle,boolean cancelable,OnCancelListener onCancelListener){
  this.mActivity=activity;
  this.mProgressDialogFragment=ProgressDialogFragment.newInstance(progressDialogMessageId,progressDialogStyle,cancelable,onCancelListener);
}

Fixed version (ground truth):
public KeychainIntentServiceHandler(Activity activity,String progressDialogMessage,int progressDialogStyle,boolean cancelable,OnCancelListener onCancelListener){
  this.mActivity=activity;
  this.mProgressDialogFragment=ProgressDialogFragment.newInstance(progressDialogMessage,progressDialogStyle,cancelable,onCancelListener);
}
Program: 8382
Project: 8382
Buggy source:
private void uploadKey(){
  Intent intent=new Intent(this,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING);
  intent.setData(mDataUri);
  Bundle data=new Bundle();
  Spinner keyServer=(Spinner)findViewById(R.id.sign_key_keyserver);
  String server=(String)keyServer.getSelectedItem();
  data.putString(KeychainIntentService.UPLOAD_KEY_SERVER,server);
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,R.string.progress_exporting,ProgressDialog.STYLE_HORIZONTAL){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Toast.makeText(CertifyKeyActivity.this,R.string.key_send_success,Toast.LENGTH_SHORT).show();
        setResult(RESULT_OK);
        finish();
      }
    }
  }
;
  Messenger messenger=new Messenger(saveHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  saveHandler.showProgressDialog(this);
  startService(intent);
}

Fixed version (ground truth):
private void uploadKey(){
  Intent intent=new Intent(this,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING);
  intent.setData(mDataUri);
  Bundle data=new Bundle();
  Spinner keyServer=(Spinner)findViewById(R.id.sign_key_keyserver);
  String server=(String)keyServer.getSelectedItem();
  data.putString(KeychainIntentService.UPLOAD_KEY_SERVER,server);
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,getString(R.string.progress_exporting),ProgressDialog.STYLE_HORIZONTAL){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Toast.makeText(CertifyKeyActivity.this,R.string.key_send_success,Toast.LENGTH_SHORT).show();
        setResult(RESULT_OK);
        finish();
      }
    }
  }
;
  Messenger messenger=new Messenger(saveHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  saveHandler.showProgressDialog(this);
  startService(intent);
}
Program: 8383
Project: 8383
Buggy source:
/** 
 * kicks off the actual signing process on a background thread
 */
private void startSigning(){
  Intent intent=new Intent(this,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_CERTIFY_KEYRING);
  Bundle data=new Bundle();
  data.putLong(KeychainIntentService.CERTIFY_KEY_MASTER_KEY_ID,mMasterKeyId);
  data.putLong(KeychainIntentService.CERTIFY_KEY_PUB_KEY_ID,mPubKeyId);
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,R.string.progress_signing,ProgressDialog.STYLE_SPINNER){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Toast.makeText(CertifyKeyActivity.this,R.string.key_sign_success,Toast.LENGTH_SHORT).show();
        if (mUploadKeyCheckbox.isChecked()) {
          uploadKey();
        }
 else {
          setResult(RESULT_OK);
          finish();
        }
      }
    }
  }
;
  Messenger messenger=new Messenger(saveHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  saveHandler.showProgressDialog(this);
  startService(intent);
}

Fixed version (ground truth):
/** 
 * kicks off the actual signing process on a background thread
 */
private void startSigning(){
  Intent intent=new Intent(this,KeychainIntentService.class);
  intent.setAction(KeychainIntentService.ACTION_CERTIFY_KEYRING);
  Bundle data=new Bundle();
  data.putLong(KeychainIntentService.CERTIFY_KEY_MASTER_KEY_ID,mMasterKeyId);
  data.putLong(KeychainIntentService.CERTIFY_KEY_PUB_KEY_ID,mPubKeyId);
  intent.putExtra(KeychainIntentService.EXTRA_DATA,data);
  KeychainIntentServiceHandler saveHandler=new KeychainIntentServiceHandler(this,getString(R.string.progress_signing),ProgressDialog.STYLE_SPINNER){
    public void handleMessage(    Message message){
      super.handleMessage(message);
      if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
        Toast.makeText(CertifyKeyActivity.this,R.string.key_sign_success,Toast.LENGTH_SHORT).show();
        if (mUploadKeyCheckbox.isChecked()) {
          uploadKey();
        }
 else {
          setResult(RESULT_OK);
          finish();
        }
      }
    }
  }
;
  Messenger messenger=new Messenger(saveHandler);
  intent.putExtra(KeychainIntentService.EXTRA_MESSENGER,messenger);
  saveHandler.showProgressDialog(this);
  startService(intent);
}
Program: 8385
Project: 8385
Buggy source:
/** 
 * Handle intent action to edit existing key
 * @param intent
 */
private void handleActionEditKey(Intent intent){
  ActionBarHelper.setDoneView(getSupportActionBar(),R.string.btn_save,new View.OnClickListener(){
    @Override public void onClick(    View v){
      saveClicked();
    }
  }
);
  mDataUri=intent.getData();
  if (mDataUri == null) {
    Log.e(Constants.TAG,"String_Node_Str");
    finish();
    return;
  }
 else {
    Log.d(Constants.TAG,"String_Node_Str" + mDataUri);
    long keyRingRowId=Long.valueOf(mDataUri.getLastPathSegment());
    long masterKeyId=ProviderHelper.getSecretMasterKeyId(this,keyRingRowId);
    masterCanSign=ProviderHelper.getSecretMasterKeyCanSign(this,keyRingRowId);
    finallyEdit(masterKeyId,masterCanSign);
  }
}

Fixed version (ground truth):
/** 
 * Handle intent action to edit existing key
 * @param intent
 */
private void handleActionEditKey(Intent intent){
  ActionBarHelper.setSaveView(getSupportActionBar(),R.string.btn_save,new View.OnClickListener(){
    @Override public void onClick(    View v){
      saveClicked();
    }
  }
);
  mDataUri=intent.getData();
  if (mDataUri == null) {
    Log.e(Constants.TAG,"String_Node_Str");
    finish();
    return;
  }
 else {
    Log.d(Constants.TAG,"String_Node_Str" + mDataUri);
    long keyRingRowId=Long.valueOf(mDataUri.getLastPathSegment());
    long masterKeyId=ProviderHelper.getSecretMasterKeyId(this,keyRingRowId);
    masterCanSign=ProviderHelper.getSecretMasterKeyCanSign(this,keyRingRowId);
    finallyEdit(masterKeyId,masterCanSign);
  }
}
Program: 8390
Project: 8390
Buggy source:
@Override public void onCreateOptionsMenu(final Menu menu,final MenuInflater inflater){
  MenuItem searchItem=menu.findItem(R.id.menu_key_list_public_search);
  mSearchView=(SearchView)MenuItemCompat.getActionView(searchItem);
  mSearchView.setOnQueryTextListener(this);
  super.onCreateOptionsMenu(menu,inflater);
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(final Menu menu,final MenuInflater inflater){
  MenuItem searchItem=menu.findItem(R.id.menu_key_list_public_search);
  mSearchView=(SearchView)MenuItemCompat.getActionView(searchItem);
  mSearchView.setOnQueryTextListener(this);
  MenuItemCompat.setOnActionExpandListener(searchItem,new MenuItemCompat.OnActionExpandListener(){
    @Override public boolean onMenuItemActionExpand(    MenuItem item){
      return true;
    }
    @Override public boolean onMenuItemActionCollapse(    MenuItem item){
      mCurQuery=null;
      getLoaderManager().restartLoader(0,null,KeyListPublicFragment.this);
      return true;
    }
  }
);
  super.onCreateOptionsMenu(menu,inflater);
}
Program: 8391
Project: 8391
Buggy source:
public void selectKey(long secretKeyId){
  if (secretKeyId == Id.key.none) {
    mKeyUserId.setText(R.string.api_settings_no_key);
    mKeyUserIdRest.setText("String_Node_Str");
  }
 else {
    String uid=getResources().getString(R.string.user_id_no_name);
    String uidExtra="String_Node_Str";
    PGPSecretKeyRing keyRing=ProviderHelper.getPGPSecretKeyRingByMasterKeyId(getActivity(),secretKeyId);
    if (keyRing != null) {
      PGPSecretKey key=PgpKeyHelper.getMasterKey(keyRing);
      if (key != null) {
        String userId=PgpKeyHelper.getMainUserIdSafe(getActivity(),key);
        String chunks[]=userId.split("String_Node_Str",2);
        uid=chunks[0];
        if (chunks.length > 1) {
          uidExtra="String_Node_Str" + chunks[1];
        }
      }
    }
    mKeyUserId.setText(uid);
    mKeyUserIdRest.setText(uidExtra);
  }
}

Fixed version (ground truth):
public void selectKey(long secretKeyId){
  if (secretKeyId == Id.key.none) {
    mKeyMasterKeyIdHex.setText(R.string.api_settings_no_key);
    mKeyUserIdRest.setText("String_Node_Str");
    mKeyUserId.setVisibility(View.GONE);
    mKeyUserIdRest.setVisibility(View.GONE);
  }
 else {
    String uid=getResources().getString(R.string.user_id_no_name);
    String uidExtra="String_Node_Str";
    String masterkeyIdHex="String_Node_Str";
    PGPSecretKeyRing keyRing=ProviderHelper.getPGPSecretKeyRingByMasterKeyId(getActivity(),secretKeyId);
    if (keyRing != null) {
      PGPSecretKey key=PgpKeyHelper.getMasterKey(keyRing);
      masterkeyIdHex=PgpKeyHelper.convertKeyIdToHex(secretKeyId);
      if (key != null) {
        String userId=PgpKeyHelper.getMainUserIdSafe(getActivity(),key);
        String[] userIdSplit=PgpKeyHelper.splitUserId(userId);
        String userName, userEmail;
        if (userIdSplit[0] != null) {
          userName=userIdSplit[0];
        }
 else {
          userName="String_Node_Str";
        }
        if (userIdSplit[1] != null) {
          userEmail=userIdSplit[1];
        }
 else {
          userEmail="String_Node_Str";
        }
        mKeyMasterKeyIdHex.setText(masterkeyIdHex);
        mKeyUserId.setText(userName);
        mKeyUserIdRest.setText(userEmail);
        mKeyUserId.setVisibility(View.VISIBLE);
        mKeyUserIdRest.setVisibility(View.VISIBLE);
      }
 else {
        mKeyMasterKeyIdHex.setText("String_Node_Str");
        mKeyUserId.setVisibility(View.GONE);
        mKeyUserIdRest.setVisibility(View.GONE);
      }
    }
 else {
      mKeyMasterKeyIdHex.setText("String_Node_Str" + secretKeyId);
      mKeyUserId.setVisibility(View.GONE);
      mKeyUserIdRest.setVisibility(View.GONE);
    }
  }
}
Program: 8392
Project: 8392
Buggy source:
/** 
 * Inflate the layout for this fragment
 */
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.select_secret_key_layout_fragment,container,false);
  mKeyUserId=(TextView)view.findViewById(R.id.select_secret_key_user_id);
  mKeyUserIdRest=(TextView)view.findViewById(R.id.select_secret_key_user_id_rest);
  mSelectKeyButton=(BootstrapButton)view.findViewById(R.id.select_secret_key_select_key_button);
  mFilterCertify=false;
  mSelectKeyButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      startSelectKeyActivity();
    }
  }
);
  return view;
}

Fixed version (ground truth):
/** 
 * Inflate the layout for this fragment
 */
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.select_secret_key_layout_fragment,container,false);
  mKeyUserId=(TextView)view.findViewById(R.id.select_secret_key_user_id);
  mKeyUserIdRest=(TextView)view.findViewById(R.id.select_secret_key_user_id_rest);
  mKeyMasterKeyIdHex=(TextView)view.findViewById(R.id.select_secret_key_master_key_hex);
  mSelectKeyButton=(BootstrapButton)view.findViewById(R.id.select_secret_key_select_key_button);
  mFilterCertify=false;
  mSelectKeyButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      startSelectKeyActivity();
    }
  }
);
  return view;
}
Program: 8393
Project: 8393
Buggy source:
/** 
 * Show dialog to delete key
 * @param keyRingRowIds
 */
public void showDeleteKeyDialog(final ActionMode mode,long[] keyRingRowIds){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
        Bundle returnData=message.getData();
        if (returnData != null && returnData.containsKey(DeleteKeyDialogFragment.MESSAGE_NOT_DELETED)) {
          ArrayList<String> notDeleted=returnData.getStringArrayList(DeleteKeyDialogFragment.MESSAGE_NOT_DELETED);
          String notDeletedMsg="String_Node_Str";
          for (          String userId : notDeleted) {
            notDeletedMsg+=userId + "String_Node_Str";
          }
          Toast.makeText(getActivity(),getString(R.string.error_can_not_delete_contacts,notDeletedMsg) + getResources().getQuantityString(R.plurals.error_can_not_delete_info,notDeleted.size()),Toast.LENGTH_LONG).show();
          mode.finish();
        }
      }
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  DeleteKeyDialogFragment deleteKeyDialog=DeleteKeyDialogFragment.newInstance(messenger,keyRingRowIds,Id.type.public_key);
  deleteKeyDialog.show(getActivity().getSupportFragmentManager(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Show dialog to delete key
 * @param keyRingRowIds
 */
@TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode,long[] keyRingRowIds){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
        Bundle returnData=message.getData();
        if (returnData != null && returnData.containsKey(DeleteKeyDialogFragment.MESSAGE_NOT_DELETED)) {
          ArrayList<String> notDeleted=returnData.getStringArrayList(DeleteKeyDialogFragment.MESSAGE_NOT_DELETED);
          String notDeletedMsg="String_Node_Str";
          for (          String userId : notDeleted) {
            notDeletedMsg+=userId + "String_Node_Str";
          }
          Toast.makeText(getActivity(),getString(R.string.error_can_not_delete_contacts,notDeletedMsg) + getResources().getQuantityString(R.plurals.error_can_not_delete_info,notDeleted.size()),Toast.LENGTH_LONG).show();
          mode.finish();
        }
      }
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  DeleteKeyDialogFragment deleteKeyDialog=DeleteKeyDialogFragment.newInstance(messenger,keyRingRowIds,Id.type.public_key);
  deleteKeyDialog.show(getActivity().getSupportFragmentManager(),"String_Node_Str");
}
Program: 8394
Project: 8394
Buggy source:
public void encrypt(ActionMode mode,long[] keyRingRowIds){
  long[] keyRingIds=new long[keyRingRowIds.length];
  for (int i=0; i < keyRingRowIds.length; i++) {
    keyRingIds[i]=ProviderHelper.getPublicMasterKeyId(getActivity(),keyRingRowIds[i]);
  }
  Intent intent=new Intent(getActivity(),EncryptActivity.class);
  intent.setAction(EncryptActivity.ACTION_ENCRYPT);
  intent.putExtra(EncryptActivity.EXTRA_ENCRYPTION_KEY_IDS,keyRingIds);
  startActivityForResult(intent,0);
  mode.finish();
}

Fixed version (ground truth):
@TargetApi(11) public void encrypt(ActionMode mode,long[] keyRingRowIds){
  long[] keyRingIds=new long[keyRingRowIds.length];
  for (int i=0; i < keyRingRowIds.length; i++) {
    keyRingIds[i]=ProviderHelper.getPublicMasterKeyId(getActivity(),keyRingRowIds[i]);
  }
  Intent intent=new Intent(getActivity(),EncryptActivity.class);
  intent.setAction(EncryptActivity.ACTION_ENCRYPT);
  intent.putExtra(EncryptActivity.EXTRA_ENCRYPTION_KEY_IDS,keyRingIds);
  startActivityForResult(intent,0);
  mode.finish();
}
Program: 8395
Project: 8395
Buggy source:
/** 
 * Show dialog to delete key
 * @param keyRingRowIds
 */
public void showDeleteKeyDialog(final ActionMode mode,long[] keyRingRowIds){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
        mode.finish();
      }
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  DeleteKeyDialogFragment deleteKeyDialog=DeleteKeyDialogFragment.newInstance(messenger,keyRingRowIds,Id.type.secret_key);
  deleteKeyDialog.show(getActivity().getSupportFragmentManager(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Show dialog to delete key
 * @param keyRingRowIds
 */
@TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode,long[] keyRingRowIds){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
        mode.finish();
      }
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  DeleteKeyDialogFragment deleteKeyDialog=DeleteKeyDialogFragment.newInstance(messenger,keyRingRowIds,Id.type.secret_key);
  deleteKeyDialog.show(getActivity().getSupportFragmentManager(),"String_Node_Str");
}
Program: 8396
Project: 8396
Buggy source:
@Override public void handleMessage(Message message){
  if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
    Intent finishIntent=new Intent();
    finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
    setResult(RESULT_OK,finishIntent);
  }
 else {
    setResult(RESULT_CANCELED);
  }
  finish();
}

Fixed version (ground truth):
@Override public void handleMessage(Message message){
  if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
    Intent finishIntent=new Intent();
    finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
    RemoteServiceActivity.this.setResult(RESULT_OK,finishIntent);
  }
 else {
    RemoteServiceActivity.this.setResult(RESULT_CANCELED);
  }
  RemoteServiceActivity.this.finish();
}
Program: 8397
Project: 8397
Buggy source:
/** 
 * Shows passphrase dialog to cache a new passphrase the user enters for using it later for encryption. Based on mSecretKeyId it asks for a passphrase to open a private key or it asks for a symmetric passphrase
 */
private void showPassphraseDialog(final Bundle params,long secretKeyId){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
        Intent finishIntent=new Intent();
        finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
        setResult(RESULT_OK,finishIntent);
      }
 else {
        setResult(RESULT_CANCELED);
      }
      finish();
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  try {
    PassphraseDialogFragment passphraseDialog=PassphraseDialogFragment.newInstance(this,messenger,secretKeyId);
    passphraseDialog.show(getSupportFragmentManager(),"String_Node_Str");
  }
 catch (  PgpGeneralException e) {
    Log.d(Constants.TAG,"String_Node_Str");
    Intent finishIntent=new Intent();
    finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
    setResult(RESULT_OK,finishIntent);
    finish();
  }
}

Fixed version (ground truth):
/** 
 * Shows passphrase dialog to cache a new passphrase the user enters for using it later for encryption. Based on mSecretKeyId it asks for a passphrase to open a private key or it asks for a symmetric passphrase
 */
private void showPassphraseDialog(final Bundle params,long secretKeyId){
  Handler returnHandler=new Handler(){
    @Override public void handleMessage(    Message message){
      if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) {
        Intent finishIntent=new Intent();
        finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
        RemoteServiceActivity.this.setResult(RESULT_OK,finishIntent);
      }
 else {
        RemoteServiceActivity.this.setResult(RESULT_CANCELED);
      }
      RemoteServiceActivity.this.finish();
    }
  }
;
  Messenger messenger=new Messenger(returnHandler);
  try {
    PassphraseDialogFragment passphraseDialog=PassphraseDialogFragment.newInstance(this,messenger,secretKeyId);
    passphraseDialog.show(getSupportFragmentManager(),"String_Node_Str");
  }
 catch (  PgpGeneralException e) {
    Log.d(Constants.TAG,"String_Node_Str");
    Intent finishIntent=new Intent();
    finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS,params);
    setResult(RESULT_OK,finishIntent);
    finish();
  }
}
Program: 8398
Project: 8398
Buggy source:
public void signAndEncrypt(Bundle params){
  params.putStringArray(OpenPgpConstants.PARAMS_USER_IDS,mEncryptUserIds.getText().toString().split("String_Node_Str"));
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(mCryptoServiceConnection.getService());
  api.signAndEncrypt(params,is,os,new MyCallback(true,os,REQUEST_CODE_SIGN_AND_ENCRYPT));
}

Fixed version (ground truth):
public void signAndEncrypt(Bundle params){
  params.putStringArray(OpenPgpConstants.PARAMS_USER_IDS,mEncryptUserIds.getText().toString().split("String_Node_Str"));
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(this,mCryptoServiceConnection.getService());
  api.signAndEncrypt(params,is,os,new MyCallback(true,os,REQUEST_CODE_SIGN_AND_ENCRYPT));
}
Program: 8399
Project: 8399
Buggy source:
public void sign(Bundle params){
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(mCryptoServiceConnection.getService());
  api.sign(params,is,os,new MyCallback(true,os,REQUEST_CODE_SIGN));
}

Fixed version (ground truth):
public void sign(Bundle params){
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(this,mCryptoServiceConnection.getService());
  api.sign(params,is,os,new MyCallback(true,os,REQUEST_CODE_SIGN));
}
Program: 8400
Project: 8400
Buggy source:
public void decryptAndVerify(Bundle params){
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(true);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(mCryptoServiceConnection.getService());
  api.decryptAndVerify(params,is,os,new MyCallback(true,os,REQUEST_CODE_DECRYPT_AND_VERIFY));
}

Fixed version (ground truth):
public void decryptAndVerify(Bundle params){
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(true);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(this,mCryptoServiceConnection.getService());
  api.decryptAndVerify(params,is,os,new MyCallback(true,os,REQUEST_CODE_DECRYPT_AND_VERIFY));
}
Program: 8401
Project: 8401
Buggy source:
public void encrypt(Bundle params){
  params.putStringArray(OpenPgpConstants.PARAMS_USER_IDS,mEncryptUserIds.getText().toString().split("String_Node_Str"));
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(mCryptoServiceConnection.getService());
  api.encrypt(params,is,os,new MyCallback(true,os,REQUEST_CODE_ENCRYPT));
}

Fixed version (ground truth):
public void encrypt(Bundle params){
  params.putStringArray(OpenPgpConstants.PARAMS_USER_IDS,mEncryptUserIds.getText().toString().split("String_Node_Str"));
  params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR,true);
  InputStream is=getInputstream(false);
  final ByteArrayOutputStream os=new ByteArrayOutputStream();
  OpenPgpApi api=new OpenPgpApi(this,mCryptoServiceConnection.getService());
  api.encrypt(params,is,os,new MyCallback(true,os,REQUEST_CODE_ENCRYPT));
}
Program: 8402
Project: 8402
Buggy source:
public void changeSecretKeyPassphrase(PGPSecretKeyRing keyRing,String oldPassPhrase,String newPassPhrase) throws IOException, PGPException, PGPException, NoSuchProviderException {
  updateProgress(R.string.progress_building_key,0,100);
  if (oldPassPhrase == null) {
    oldPassPhrase="String_Node_Str";
  }
  if (newPassPhrase == null) {
    newPassPhrase="String_Node_Str";
  }
  PGPSecretKeyRing newKeyRing=PGPSecretKeyRing.copyWithNewPassword(keyRing,new JcePBESecretKeyDecryptorBuilder(new JcaPGPDigestCalculatorProviderBuilder().setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build()).setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(oldPassPhrase.toCharArray()),new JcePBESecretKeyEncryptorBuilder(keyRing.getSecretKey().getKeyEncryptionAlgorithm()).build(newPassPhrase.toCharArray()));
  updateProgress(R.string.progress_saving_key_ring,50,100);
  ProviderHelper.saveKeyRing(mContext,newKeyRing);
  updateProgress(R.string.progress_done,100,100);
}

Fixed version (ground truth):
public void changeSecretKeyPassphrase(PGPSecretKeyRing keyRing,String oldPassPhrase,String newPassPhrase) throws IOException, PGPException {
  updateProgress(R.string.progress_building_key,0,100);
  if (oldPassPhrase == null) {
    oldPassPhrase="String_Node_Str";
  }
  if (newPassPhrase == null) {
    newPassPhrase="String_Node_Str";
  }
  PGPSecretKeyRing newKeyRing=PGPSecretKeyRing.copyWithNewPassword(keyRing,new JcePBESecretKeyDecryptorBuilder(new JcaPGPDigestCalculatorProviderBuilder().setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build()).setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(oldPassPhrase.toCharArray()),new JcePBESecretKeyEncryptorBuilder(keyRing.getSecretKey().getKeyEncryptionAlgorithm()).build(newPassPhrase.toCharArray()));
  updateProgress(R.string.progress_saving_key_ring,50,100);
  ProviderHelper.saveKeyRing(mContext,newKeyRing);
  updateProgress(R.string.progress_done,100,100);
}
Program: 8403
Project: 8403
Buggy source:
public void updateProgress(int current,int total){
  if (mProgress != null) {
    mProgress.setProgress(current,total);
  }
}

Fixed version (ground truth):
void updateProgress(int current,int total){
  if (mProgress != null) {
    mProgress.setProgress(current,total);
  }
}
Program: 8407
Project: 8407
Buggy source:
/** 
 * Constructor based on key object, used for import from NFC, QR Codes, files
 */
@SuppressWarnings("String_Node_Str") public ImportKeysListEntry(PGPKeyRing pgpKeyRing){
  try {
    this.bytes=pgpKeyRing.getEncoded();
  }
 catch (  IOException e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
  }
  this.selected=true;
  if (pgpKeyRing instanceof PGPSecretKeyRing) {
    secretKey=true;
  }
 else {
    secretKey=false;
  }
  userIds=new ArrayList<String>();
  for (  String userId : new IterableIterator<String>(pgpKeyRing.getPublicKey().getUserIDs())) {
    userIds.add(userId);
  }
  this.keyId=pgpKeyRing.getPublicKey().getKeyID();
  this.revoked=pgpKeyRing.getPublicKey().isRevoked();
  this.fingerPrint=PgpKeyHelper.convertFingerprintToHex(pgpKeyRing.getPublicKey().getFingerprint(),true);
  this.hexKeyId=PgpKeyHelper.convertKeyIdToHex(keyId);
  this.bitStrength=pgpKeyRing.getPublicKey().getBitStrength();
  int algorithm=pgpKeyRing.getPublicKey().getAlgorithm();
  if (algorithm == PGPPublicKey.RSA_ENCRYPT || algorithm == PGPPublicKey.RSA_GENERAL || algorithm == PGPPublicKey.RSA_SIGN) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.DSA) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.ELGAMAL_ENCRYPT || algorithm == PGPPublicKey.ELGAMAL_GENERAL) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.EC || algorithm == PGPPublicKey.ECDSA) {
    this.algorithm="String_Node_Str";
  }
 else {
    this.algorithm="String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Constructor based on key object, used for import from NFC, QR Codes, files
 */
@SuppressWarnings("String_Node_Str") public ImportKeysListEntry(PGPKeyRing pgpKeyRing){
  try {
    this.bytes=pgpKeyRing.getEncoded();
  }
 catch (  IOException e) {
    Log.e(Constants.TAG,"String_Node_Str",e);
  }
  this.selected=true;
  if (pgpKeyRing instanceof PGPSecretKeyRing) {
    secretKey=true;
  }
 else {
    secretKey=false;
  }
  userIds=new ArrayList<String>();
  for (  String userId : new IterableIterator<String>(pgpKeyRing.getPublicKey().getUserIDs())) {
    userIds.add(userId);
  }
  this.keyId=pgpKeyRing.getPublicKey().getKeyID();
  this.revoked=pgpKeyRing.getPublicKey().isRevoked();
  this.fingerPrint=PgpKeyHelper.convertFingerprintToHex(pgpKeyRing.getPublicKey().getFingerprint(),true);
  this.hexKeyId="String_Node_Str" + PgpKeyHelper.convertKeyIdToHex(keyId);
  this.bitStrength=pgpKeyRing.getPublicKey().getBitStrength();
  int algorithm=pgpKeyRing.getPublicKey().getAlgorithm();
  if (algorithm == PGPPublicKey.RSA_ENCRYPT || algorithm == PGPPublicKey.RSA_GENERAL || algorithm == PGPPublicKey.RSA_SIGN) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.DSA) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.ELGAMAL_ENCRYPT || algorithm == PGPPublicKey.ELGAMAL_GENERAL) {
    this.algorithm="String_Node_Str";
  }
 else   if (algorithm == PGPPublicKey.EC || algorithm == PGPPublicKey.ECDSA) {
    this.algorithm="String_Node_Str";
  }
 else {
    this.algorithm="String_Node_Str";
  }
}
Program: 8408
Project: 8408
Buggy source:
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  Uri baseUri=KeyRings.buildPublicKeyRingsUri();
  long now=new Date().getTime() / 1000;
  String[] projection=new String[]{KeyRings._ID,KeyRings.MASTER_KEY_ID,UserIds.USER_ID,"String_Node_Str" + Keys._ID + "String_Node_Str"+ Tables.KEYS+ "String_Node_Str"+ Keys.KEY_RING_ROW_ID+ "String_Node_Str"+ KeychainDatabase.Tables.KEY_RINGS+ "String_Node_Str"+ KeyRings._ID+ "String_Node_Str"+ Keys.IS_REVOKED+ "String_Node_Str"+ Keys.CAN_SIGN+ "String_Node_Str"+ SelectKeyCursorAdapter.PROJECTION_ROW_AVAILABLE,"String_Node_Str" + Keys._ID + "String_Node_Str"+ Tables.KEYS+ "String_Node_Str"+ Keys.KEY_RING_ROW_ID+ "String_Node_Str"+ KeychainDatabase.Tables.KEY_RINGS+ "String_Node_Str"+ KeyRings._ID+ "String_Node_Str"+ Keys.IS_REVOKED+ "String_Node_Str"+ Keys.CAN_SIGN+ "String_Node_Str"+ Keys.CREATION+ "String_Node_Str"+ now+ "String_Node_Str"+ "String_Node_Str"+ Keys.EXPIRY+ "String_Node_Str"+ Keys.EXPIRY+ "String_Node_Str"+ now+ "String_Node_Str"+ SelectKeyCursorAdapter.PROJECTION_ROW_VALID};
  String orderBy=UserIds.USER_ID + "String_Node_Str";
  return new CursorLoader(getActivity(),baseUri,projection,null,null,orderBy);
}

Fixed version (ground truth):
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  Uri baseUri=KeyRings.buildSecretKeyRingsUri();
  long now=new Date().getTime() / 1000;
  String[] projection=new String[]{KeyRings._ID,KeyRings.MASTER_KEY_ID,UserIds.USER_ID,"String_Node_Str" + Keys._ID + "String_Node_Str"+ Tables.KEYS+ "String_Node_Str"+ Keys.KEY_RING_ROW_ID+ "String_Node_Str"+ KeychainDatabase.Tables.KEY_RINGS+ "String_Node_Str"+ KeyRings._ID+ "String_Node_Str"+ Keys.IS_REVOKED+ "String_Node_Str"+ Keys.CAN_SIGN+ "String_Node_Str"+ SelectKeyCursorAdapter.PROJECTION_ROW_AVAILABLE,"String_Node_Str" + Keys._ID + "String_Node_Str"+ Tables.KEYS+ "String_Node_Str"+ Keys.KEY_RING_ROW_ID+ "String_Node_Str"+ KeychainDatabase.Tables.KEY_RINGS+ "String_Node_Str"+ KeyRings._ID+ "String_Node_Str"+ Keys.IS_REVOKED+ "String_Node_Str"+ Keys.CAN_SIGN+ "String_Node_Str"+ Keys.CREATION+ "String_Node_Str"+ now+ "String_Node_Str"+ "String_Node_Str"+ Keys.EXPIRY+ "String_Node_Str"+ Keys.EXPIRY+ "String_Node_Str"+ now+ "String_Node_Str"+ SelectKeyCursorAdapter.PROJECTION_ROW_VALID};
  System.out.println(projection);
  String orderBy=UserIds.USER_ID + "String_Node_Str";
  return new CursorLoader(getActivity(),baseUri,projection,null,null,orderBy);
}
Program: 8409
Project: 8409
Buggy source:
/** 
 * Converts Vector<PGPSecretKey> to a byte[]
 * @param keys
 * @return
 */
public static byte[] PGPSecretKeyListToBytes(Vector<PGPSecretKey> keys){
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  for (  PGPSecretKey key : keys) {
    try {
      key.encode(os);
    }
 catch (    IOException e) {
      Log.e(Constants.TAG,"String_Node_Str",e);
    }
  }
  byte[] keysBytes=os.toByteArray();
  return keysBytes;
}

Fixed version (ground truth):
/** 
 * Converts Vector<PGPSecretKey> to a byte[]
 * @param keys
 * @return
 */
public static byte[] PGPSecretKeyListToBytes(ArrayList<PGPSecretKey> keys){
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  for (  PGPSecretKey key : keys) {
    try {
      key.encode(os);
    }
 catch (    IOException e) {
      Log.e(Constants.TAG,"String_Node_Str",e);
    }
  }
  byte[] keysBytes=os.toByteArray();
  return keysBytes;
}
Program: 8415
Project: 8415
Buggy source:
public static Bundle exportKeyRings(Context context,Vector<Integer> keyRingIds,OutputStream outStream,ProgressDialogUpdater progress) throws GeneralException, FileNotFoundException, PGPException, IOException {
  Bundle returnData=new Bundle();
  if (keyRingIds.size() == 1) {
    if (progress != null)     progress.setProgress(R.string.progress_exportingKey,0,100);
  }
 else {
    if (progress != null)     progress.setProgress(R.string.progress_exportingKeys,0,100);
  }
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    throw new GeneralException(context.getString(R.string.error_externalStorageNotReady));
  }
  ArmoredOutputStream out=new ArmoredOutputStream(outStream);
  out.setHeader("String_Node_Str",getFullVersion(context));
  int numKeys=0;
  for (int i=0; i < keyRingIds.size(); ++i) {
    if (progress != null)     progress.setProgress(i * 100 / keyRingIds.size(),100);
    Object obj=mDatabase.getKeyRing(keyRingIds.get(i));
    PGPPublicKeyRing publicKeyRing;
    PGPSecretKeyRing secretKeyRing;
    if (obj instanceof PGPSecretKeyRing) {
      secretKeyRing=(PGPSecretKeyRing)obj;
      secretKeyRing.encode(out);
    }
 else     if (obj instanceof PGPPublicKeyRing) {
      publicKeyRing=(PGPPublicKeyRing)obj;
      publicKeyRing.encode(out);
    }
 else {
      continue;
    }
    ++numKeys;
  }
  out.close();
  returnData.putInt(ApgService.RESULT_EXPORT,numKeys);
  if (progress != null)   progress.setProgress(R.string.progress_done,100,100);
  return returnData;
}

Fixed version (ground truth):
public static Bundle exportKeyRings(Context context,Vector<Integer> keyRingIds,OutputStream outStream,ProgressDialogUpdater progress) throws GeneralException, FileNotFoundException, PGPException, IOException {
  Bundle returnData=new Bundle();
  if (keyRingIds.size() == 1) {
    updateProgress(progress,R.string.progress_exportingKey,0,100);
  }
 else {
    updateProgress(progress,R.string.progress_exportingKeys,0,100);
  }
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    throw new GeneralException(context.getString(R.string.error_externalStorageNotReady));
  }
  ArmoredOutputStream out=new ArmoredOutputStream(outStream);
  out.setHeader("String_Node_Str",getFullVersion(context));
  int numKeys=0;
  for (int i=0; i < keyRingIds.size(); ++i) {
    updateProgress(progress,i * 100 / keyRingIds.size(),100);
    Object obj=mDatabase.getKeyRing(keyRingIds.get(i));
    PGPPublicKeyRing publicKeyRing;
    PGPSecretKeyRing secretKeyRing;
    if (obj instanceof PGPSecretKeyRing) {
      secretKeyRing=(PGPSecretKeyRing)obj;
      secretKeyRing.encode(out);
    }
 else     if (obj instanceof PGPPublicKeyRing) {
      publicKeyRing=(PGPPublicKeyRing)obj;
      publicKeyRing.encode(out);
    }
 else {
      continue;
    }
    ++numKeys;
  }
  out.close();
  returnData.putInt(ApgService.RESULT_EXPORT,numKeys);
  updateProgress(progress,R.string.progress_done,100,100);
  return returnData;
}