Program: 8218
Project: 8218
Buggy source:
@Override protected void onSecurityTokenPostExecute(){
  long tokenId=KeyFormattingUtils.getKeyIdFromFingerprint(mSecurityTokenFingerprints);
  try {
    CachedPublicKeyRing ring=mKeyRepository.getCachedPublicKeyRing(KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(tokenId));
    byte[] candidateFp=ring.getFingerprint();
    if (KeyFormattingUtils.convertFingerprintToHex(candidateFp).equals(mFingerprintString)) {
      showSecurityTokenFragment(mSecurityTokenFingerprints,mSecurityTokenUserId,mSecurityTokenAid,mSecurityTokenVersion);
      return;
    }
    final long masterKeyId=KeyFormattingUtils.getKeyIdFromFingerprint(candidateFp);
    Notify.create(this,R.string.snack_security_token_other,Notify.LENGTH_LONG,Style.WARN,new ActionListener(){
      @Override public void onAction(){
        Intent intent=new Intent(ViewKeyActivity.this,ViewKeyActivity.class);
        intent.setData(KeyRings.buildGenericKeyRingUri(masterKeyId));
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_AID,mSecurityTokenAid);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_VERSION,mSecurityTokenVersion);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_USER_ID,mSecurityTokenUserId);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_FINGERPRINTS,mSecurityTokenFingerprints);
        startActivity(intent);
        finish();
      }
    }
,R.string.snack_security_token_view).show();
  }
 catch (  PgpKeyNotFoundException e) {
    Notify.create(this,R.string.snack_security_token_other,Notify.LENGTH_LONG,Style.WARN,new ActionListener(){
      @Override public void onAction(){
        Intent intent=new Intent(ViewKeyActivity.this,CreateKeyActivity.class);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_AID,mSecurityTokenAid);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_VERSION,mSecurityTokenVersion);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_USER_ID,mSecurityTokenUserId);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_FINGERPRINTS,mSecurityTokenFingerprints);
        startActivity(intent);
        finish();
      }
    }
,R.string.snack_security_token_import).show();
  }
}

Fixed version (ground truth):
@Override protected void onSecurityTokenPostExecute(){
  long tokenId=KeyFormattingUtils.getKeyIdFromFingerprint(mSecurityTokenFingerprints);
  try {
    CachedPublicKeyRing ring=mKeyRepository.getCachedPublicKeyRing(KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(tokenId));
    byte[] candidateFp=ring.getFingerprint();
    if (Arrays.equals(candidateFp,mFingerprint)) {
      showSecurityTokenFragment(mSecurityTokenFingerprints,mSecurityTokenUserId,mSecurityTokenAid,mSecurityTokenVersion);
      return;
    }
    final long masterKeyId=KeyFormattingUtils.getKeyIdFromFingerprint(candidateFp);
    Notify.create(this,R.string.snack_security_token_other,Notify.LENGTH_LONG,Style.WARN,new ActionListener(){
      @Override public void onAction(){
        Intent intent=new Intent(ViewKeyActivity.this,ViewKeyActivity.class);
        intent.setData(KeyRings.buildGenericKeyRingUri(masterKeyId));
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_AID,mSecurityTokenAid);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_VERSION,mSecurityTokenVersion);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_USER_ID,mSecurityTokenUserId);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_FINGERPRINTS,mSecurityTokenFingerprints);
        startActivity(intent);
        finish();
      }
    }
,R.string.snack_security_token_view).show();
  }
 catch (  PgpKeyNotFoundException e) {
    Notify.create(this,R.string.snack_security_token_other,Notify.LENGTH_LONG,Style.WARN,new ActionListener(){
      @Override public void onAction(){
        Intent intent=new Intent(ViewKeyActivity.this,CreateKeyActivity.class);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_AID,mSecurityTokenAid);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_VERSION,mSecurityTokenVersion);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_USER_ID,mSecurityTokenUserId);
        intent.putExtra(ViewKeyActivity.EXTRA_SECURITY_TOKEN_FINGERPRINTS,mSecurityTokenFingerprints);
        startActivity(intent);
        finish();
      }
    }
,R.string.snack_security_token_import).show();
  }
}