Program: 187446
Project: 187446
Buggy source:
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.new_message);
  Prephase2Activity.dba=new DBAccessor(this);
  Prephase2Activity.sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  sendSMS=(Button)findViewById(R.id.new_message_send);
  phoneBox=(EditText)findViewById(R.id.new_message_number);
  messageBox=(EditText)findViewById(R.id.new_message_message);
  sendSMS.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      String number=phoneBox.getText().toString();
      String text=messageBox.getText().toString();
      if (number.length() > 0 && text.length() > 0) {
        try {
          if (Prephase2Activity.dba.isTrustedContact(number) && Prephase2Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
            sendSMS(number,Encryption.aes_encrypt(Prephase2Activity.dba.getRow(ContactRetriever.format(number)).getKey(),text));
            Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
          }
 else {
            sendSMS(number,text);
            Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
          }
          if (Prephase2Activity.dba.getRow(ContactRetriever.format(number)) == null) {
            AddContact.editTc=new TrustedContact("String_Node_Str",number,null,0);
            AlertDialog.Builder builder=new AlertDialog.Builder(SendMessageActivity.this);
            builder.setMessage("String_Node_Str" + number + "String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
              public void onClick(              DialogInterface dialog,              int id){
                SendMessageActivity.this.startActivity(new Intent(SendMessageActivity.this,AddContact.class));
                finish();
              }
            }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
              public void onClick(              DialogInterface dialog,              int id){
                dialog.cancel();
              }
            }
);
            AlertDialog alert=builder.create();
            alert.show();
          }
          messageBox.setText("String_Node_Str");
          phoneBox.setText("String_Node_Str");
        }
 catch (        Exception e) {
          Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
          e.printStackTrace();
        }
      }
 else {
        AlertDialog.Builder builder=new AlertDialog.Builder(SendMessageActivity.this);
        builder.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int id){
          }
        }
);
        AlertDialog alert=builder.create();
        alert.show();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.new_message);
  Prephase2Activity.dba=new DBAccessor(this);
  Prephase2Activity.sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  sendSMS=(Button)findViewById(R.id.new_message_send);
  phoneBox=(EditText)findViewById(R.id.new_message_number);
  messageBox=(EditText)findViewById(R.id.new_message_message);
  sendSMS.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      final String number=phoneBox.getText().toString();
      String text=messageBox.getText().toString();
      if (number.length() > 0 && text.length() > 0) {
        try {
          if (Prephase2Activity.dba.isTrustedContact(number) && Prephase2Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
            sendSMS(number,Encryption.aes_encrypt(Prephase2Activity.dba.getRow(ContactRetriever.format(number)).getKey(),text));
            Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
          }
 else {
            sendSMS(number,text);
            Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
          }
          if (Prephase2Activity.dba.getRow(ContactRetriever.format(number)) == null) {
            AlertDialog.Builder builder=new AlertDialog.Builder(SendMessageActivity.this);
            builder.setMessage("String_Node_Str" + number + "String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
              public void onClick(              DialogInterface dialog,              int id){
                AddContact.editTc=new TrustedContact("String_Node_Str","String_Node_Str",null,0);
                AddContact.editTc.addNumber(number);
                SendMessageActivity.this.startActivity(new Intent(SendMessageActivity.this,AddContact.class));
                finish();
              }
            }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
              public void onClick(              DialogInterface dialog,              int id){
                dialog.cancel();
              }
            }
);
            AlertDialog alert=builder.create();
            alert.show();
          }
          messageBox.setText("String_Node_Str");
          phoneBox.setText("String_Node_Str");
        }
 catch (        Exception e) {
          Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
          e.printStackTrace();
        }
      }
 else {
        AlertDialog.Builder builder=new AlertDialog.Builder(SendMessageActivity.this);
        builder.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int id){
          }
        }
);
        AlertDialog alert=builder.create();
        alert.show();
      }
    }
  }
);
}