Program: 187425
Project: 187425
Buggy source:
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dba=new DBAccessor(this);
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  list=(ListView)findViewById(R.id.conversation_list);
  msgList=ContactRetriever.getSMS(this);
  MessageAdapter adapter=new MessageAdapter(this,R.layout.listview_item_row,msgList);
  list.setAdapter(adapter);
  list.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectedNumber=msgList.get(position)[0];
      startActivity(new Intent(getBaseContext(),MessageView.class));
    }
  }
);
  final String SMS_RECEIVED="String_Node_Str";
  BroadcastReceiver SMSbr=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      Bundle bundle=intent.getExtras();
      if (bundle != null) {
        Object[] pdus=(Object[])bundle.get("String_Node_Str");
        final SmsMessage[] messages=new SmsMessage[pdus.length];
        for (int i=0; i < pdus.length; i++) {
          messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
        }
        if (messages.length > -1) {
          String address=messages[0].getOriginatingAddress();
          if (dba.isTrustedContact((address))) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            try {
              sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),messages[0].getMessageBody(),INBOX);
              sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),Encryption.aes_decrypt(dba.getRow(ContactRetriever.format(address)).getPublicKey(),messages[0].getMessageBody()),INBOX);
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
              updateList();
            }
 catch (            Exception e) {
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
              e.printStackTrace();
            }
          }
 else {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),messages[0].getMessageBody(),INBOX);
            updateList();
          }
        }
      }
      this.abortBroadcast();
    }
  }
;
  IntentFilter SMSfilter=new IntentFilter(SMS_RECEIVED);
  this.registerReceiver(SMSbr,SMSfilter);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dba=new DBAccessor(this);
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  list=(ListView)findViewById(R.id.conversation_list);
  msgList=ContactRetriever.getSMS(this);
  MessageAdapter adapter=new MessageAdapter(this,R.layout.listview_item_row,msgList);
  list.setAdapter(adapter);
  list.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectedNumber=msgList.get(position)[0];
      startActivity(new Intent(getBaseContext(),MessageView.class));
    }
  }
);
  final String SMS_RECEIVED="String_Node_Str";
  SMSbr=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      Bundle bundle=intent.getExtras();
      if (bundle != null) {
        Object[] pdus=(Object[])bundle.get("String_Node_Str");
        final SmsMessage[] messages=new SmsMessage[pdus.length];
        for (int i=0; i < pdus.length; i++) {
          messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
        }
        if (messages.length > -1) {
          String address=messages[0].getOriginatingAddress();
          if (dba.isTrustedContact((address))) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            try {
              sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),messages[0].getMessageBody(),INBOX);
              sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),Encryption.aes_decrypt(dba.getRow(ContactRetriever.format(address)).getPublicKey(),messages[0].getMessageBody()),INBOX);
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
              updateList();
            }
 catch (            Exception e) {
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
              e.printStackTrace();
            }
          }
 else {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            sendToSelf(getBaseContext(),messages[0].getOriginatingAddress(),messages[0].getMessageBody(),INBOX);
            updateList();
          }
        }
      }
      this.abortBroadcast();
    }
  }
;
  IntentFilter SMSfilter=new IntentFilter(SMS_RECEIVED);
  this.registerReceiver(SMSbr,SMSfilter);
}