Program: 187431
Project: 187431
Buggy source:
/** 
 * Access the information stored in the database of a contact who has a certain number with the columns: name, number, key, verified.
 * @param number : String the number of the contact to retrieve 
 * @return TrustedContact, the row of data.
 */
public TrustedContact getRow(String number){
  open();
  Cursor idCur=db.query(SQLitehelper.NUMBERS_TABLE_NAME,new String[]{KEY_REFERENCE,KEY_NUMBER},KEY_NUMBER + "String_Node_Str" + number,null,null,null,null);
  int id=0;
  if (idCur.moveToFirst()) {
    id=idCur.getInt(idCur.getColumnIndex(KEY_REFERENCE));
  }
  idCur.close();
  Cursor cur=db.query(SQLitehelper.TRUSTED_TABLE_NAME,null,KEY_ID + "String_Node_Str" + id,null,null,null,null);
  if (cur.moveToFirst()) {
    TrustedContact tc=new TrustedContact(cur.getString(cur.getColumnIndex(KEY_NAME)),cur.getBlob(cur.getColumnIndex(KEY_PUBLIC_KEY)),cur.getBlob(cur.getColumnIndex(KEY_SIGNATURE)));
    Cursor pCur=db.query(SQLitehelper.TRUSTED_TABLE_NAME + "String_Node_Str" + SQLitehelper.NUMBERS_TABLE_NAME,new String[]{SQLitehelper.NUMBERS_TABLE_NAME + "String_Node_Str" + KEY_NUMBER},SQLitehelper.TRUSTED_TABLE_NAME + "String_Node_Str" + KEY_ID+ "String_Node_Str"+ SQLitehelper.NUMBERS_TABLE_NAME+ "String_Node_Str"+ KEY_REFERENCE+ "String_Node_Str"+ SQLitehelper.TRUSTED_TABLE_NAME+ "String_Node_Str"+ KEY_ID+ "String_Node_Str"+ id,null,null,null,null);
    if (pCur.moveToFirst()) {
      do {
        tc.addNumber(pCur.getString(pCur.getColumnIndex(KEY_NUMBER)));
      }
 while (pCur.moveToNext());
      pCur.close();
    }
    close(cur);
    String columns[]=getBookPath(id);
    tc.setBookPath(columns[0]);
    tc.setBookInversePath(columns[1]);
    columns=getSharedInfo(id);
    tc.setSharedInfo1(columns[0]);
    tc.setSharedInfo2(columns[1]);
    return tc;
  }
  close(cur);
  return null;
}

Fixed version (ground truth):
/** 
 * Access the information stored in the database of a contact who has a certain number with the columns: name, number, key, verified.
 * @param number : String the number of the contact to retrieve 
 * @return TrustedContact, the row of data.
 */
public TrustedContact getRow(String number){
  open();
  Cursor idCur=db.rawQuery("String_Node_Str" + KEY_REFERENCE + "String_Node_Str"+ KEY_NUMBER+ "String_Node_Str"+ SQLitehelper.NUMBERS_TABLE_NAME+ "String_Node_Str"+ KEY_NUMBER+ "String_Node_Str",new String[]{number});
  int id=0;
  if (idCur.moveToFirst()) {
    id=idCur.getInt(idCur.getColumnIndex(KEY_REFERENCE));
  }
  idCur.close();
  Cursor cur=db.query(SQLitehelper.TRUSTED_TABLE_NAME,null,KEY_ID + "String_Node_Str" + id,null,null,null,null);
  if (cur.moveToFirst()) {
    TrustedContact tc=new TrustedContact(cur.getString(cur.getColumnIndex(KEY_NAME)),cur.getBlob(cur.getColumnIndex(KEY_PUBLIC_KEY)),cur.getBlob(cur.getColumnIndex(KEY_SIGNATURE)));
    Cursor pCur=db.query(SQLitehelper.TRUSTED_TABLE_NAME + "String_Node_Str" + SQLitehelper.NUMBERS_TABLE_NAME,new String[]{SQLitehelper.NUMBERS_TABLE_NAME + "String_Node_Str" + KEY_NUMBER},SQLitehelper.TRUSTED_TABLE_NAME + "String_Node_Str" + KEY_ID+ "String_Node_Str"+ SQLitehelper.NUMBERS_TABLE_NAME+ "String_Node_Str"+ KEY_REFERENCE+ "String_Node_Str"+ SQLitehelper.TRUSTED_TABLE_NAME+ "String_Node_Str"+ KEY_ID+ "String_Node_Str"+ id,null,null,null,null);
    if (pCur.moveToFirst()) {
      do {
        tc.addNumber(pCur.getString(pCur.getColumnIndex(KEY_NUMBER)));
      }
 while (pCur.moveToNext());
      pCur.close();
    }
    close(cur);
    String columns[]=getBookPath(id);
    tc.setBookPath(columns[0]);
    tc.setBookInversePath(columns[1]);
    columns=getSharedInfo(id);
    tc.setSharedInfo1(columns[0]);
    tc.setSharedInfo2(columns[1]);
    return tc;
  }
  close(cur);
  return null;
}