Program: 187459
Project: 187459
Buggy source:
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.contact);
  ListView listView;
  final ArrayList<TrustedContact> tc=Prephase1Activity.dba.getAllRows();
  String[] names=new String[tc.size()];
  for (int i=0; i < tc.size(); i++) {
    names[i]=tc.get(i).getName();
  }
  listView=(ListView)findViewById(R.id.listView1);
  listView.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,names));
  listView.setItemsCanFocus(false);
  listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  listView.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      final String key="String_Node_Str";
      final int verify=2;
      Toast.makeText(getApplicationContext(),tc.get(position).getKey(),Toast.LENGTH_SHORT).show();
      if (Prephase1Activity.dba.isTrustedContact(tc.get(position).getNumber())) {
        tc.get(position).setKey(null);
        tc.get(position).setVerified(0);
        Prephase1Activity.dba.removeRow(tc.get(position).getNumber());
        Prephase1Activity.dba.addRow(tc.get(position));
        Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
 else {
        tc.get(position).setKey(key);
        tc.get(position).setVerified(verify);
        Prephase1Activity.dba.removeRow(tc.get(position).getNumber());
        Prephase1Activity.dba.addRow(tc.get(position));
        Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.contact);
  ListView listView;
  String[] names;
  listView=(ListView)findViewById(R.id.listView1);
  final ArrayList<TrustedContact> tc=Prephase1Activity.dba.getAllRows();
  if (tc != null) {
    names=new String[tc.size()];
    for (int i=0; i < tc.size(); i++) {
      names[i]=tc.get(i).getName();
    }
    listView.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,names));
    listView.setItemsCanFocus(false);
    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  }
 else {
    names=new String[1];
    names[0]="String_Node_Str";
    listView.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,names));
    listView.setItemsCanFocus(false);
  }
  listView.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      final String key="String_Node_Str";
      final int verify=2;
      if (tc != null) {
        if (Prephase1Activity.dba.isTrustedContact(tc.get(position).getNumber())) {
          tc.get(position).setKey(null);
          tc.get(position).setVerified(0);
          Prephase1Activity.dba.removeRow(tc.get(position).getNumber());
          Prephase1Activity.dba.addRow(tc.get(position));
          Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
 else {
          tc.get(position).setKey(key);
          tc.get(position).setVerified(verify);
          Prephase1Activity.dba.removeRow(tc.get(position).getNumber());
          Prephase1Activity.dba.addRow(tc.get(position));
          Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
 else {
      }
    }
  }
);
}