Program: 187451
Project: 187451
Buggy source:
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.messages);
  dba=new DBAccessor(this);
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  final ListView list=(ListView)findViewById(R.id.listView1);
  msgList=getSMS();
  list.setAdapter(new ArrayAdapter<String>(this,android.R.layout.test_list_item,messageMaker(msgList)));
  list.setItemsCanFocus(false);
  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 mess=messages[0].getOriginatingAddress();
          if (dba.isTrustedContact(mess)) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            try {
              sendToSelf(messages[0].getOriginatingAddress(),messages[0].getMessageBody());
              sendToSelf(messages[0].getOriginatingAddress(),Encryption.aes_decrypt(PASSWORD,messages[0].getMessageBody()));
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
              msgList=getSMS();
              list.setAdapter(new ArrayAdapter<String>(getBaseContext(),android.R.layout.test_list_item,messageMaker(msgList)));
              list.setItemsCanFocus(false);
            }
 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();
            msgList=getSMS();
            list.setAdapter(new ArrayAdapter<String>(getBaseContext(),android.R.layout.test_list_item,messageMaker(msgList)));
            list.setItemsCanFocus(false);
          }
        }
      }
      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.messages);
  dba=new DBAccessor(this);
  sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  final ListView list=(ListView)findViewById(R.id.listView1);
  msgList=getSMS();
  list.setAdapter(new ArrayAdapter<String>(this,android.R.layout.test_list_item,messageMaker(msgList)));
  list.setItemsCanFocus(false);
  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 mess=messages[0].getOriginatingAddress();
          if (dba.isTrustedContact(mess)) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            Toast.makeText(context,messages[0].getMessageBody(),Toast.LENGTH_LONG).show();
            try {
              sendToSelf(messages[0].getOriginatingAddress(),messages[0].getMessageBody());
              sendToSelf(messages[0].getOriginatingAddress(),Encryption.aes_decrypt(PASSWORD,messages[0].getMessageBody()));
              Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
              msgList=getSMS();
              list.setAdapter(new ArrayAdapter<String>(getBaseContext(),android.R.layout.test_list_item,messageMaker(msgList)));
              list.setItemsCanFocus(false);
            }
 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(messages[0].getOriginatingAddress(),messages[0].getMessageBody());
            msgList=getSMS();
            list.setAdapter(new ArrayAdapter<String>(getBaseContext(),android.R.layout.test_list_item,messageMaker(msgList)));
            list.setItemsCanFocus(false);
          }
        }
      }
      this.abortBroadcast();
    }
  }
;
  IntentFilter SMSfilter=new IntentFilter(SMS_RECEIVED);
  this.registerReceiver(SMSbr,SMSfilter);
}