Program: 14526
Project: 14526
Buggy source:
public List<Map<String,Object>> getAccountsBy(String byString,String[] extraFields,int limit){
  if (db == null) {
    return new Vector<Map<String,Object>>();
  }
  String limitStr=null;
  if (limit == 0) {
    limitStr=String.valueOf(limit);
  }
  String[] baseFields=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] allFields=baseFields;
  if (extraFields != null) {
    allFields=(String[])ArrayUtils.addAll(baseFields,extraFields);
  }
  Cursor c=db.query(SETTINGS_TABLE,allFields,byString,null,null,null,null,limitStr);
  int numRows=c.getCount();
  c.moveToFirst();
  List<Map<String,Object>> accounts=new Vector<Map<String,Object>>();
  for (int i=0; i < numRows; i++) {
    int id=c.getInt(0);
    String blogName=c.getString(1);
    String username=c.getString(2);
    int blogId=c.getInt(3);
    String url=c.getString(4);
    String password=c.getString(5);
    if (password != null && !password.equals("String_Node_Str") && id > 0) {
      Map<String,Object> thisHash=new HashMap<String,Object>();
      thisHash.put("String_Node_Str",id);
      thisHash.put("String_Node_Str",blogName);
      thisHash.put("String_Node_Str",username);
      thisHash.put("String_Node_Str",blogId);
      thisHash.put("String_Node_Str",url);
      if (extraFields != null) {
        for (int j=0; j < extraFields.length; ++j) {
          thisHash.put(extraFields[j],c.getString(6 + j));
        }
      }
      accounts.add(thisHash);
    }
    c.moveToNext();
  }
  c.close();
  Collections.sort(accounts,BlogUtils.BlogNameComparator);
  return accounts;
}

Fixed version (ground truth):
public List<Map<String,Object>> getAccountsBy(String byString,String[] extraFields,int limit){
  if (db == null) {
    return new Vector<Map<String,Object>>();
  }
  String limitStr=null;
  if (limit != 0) {
    limitStr=String.valueOf(limit);
  }
  String[] baseFields=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] allFields=baseFields;
  if (extraFields != null) {
    allFields=(String[])ArrayUtils.addAll(baseFields,extraFields);
  }
  Cursor c=db.query(SETTINGS_TABLE,allFields,byString,null,null,null,null,limitStr);
  int numRows=c.getCount();
  c.moveToFirst();
  List<Map<String,Object>> accounts=new Vector<Map<String,Object>>();
  for (int i=0; i < numRows; i++) {
    int id=c.getInt(0);
    String blogName=c.getString(1);
    String username=c.getString(2);
    int blogId=c.getInt(3);
    String url=c.getString(4);
    String password=c.getString(5);
    if (password != null && !password.equals("String_Node_Str") && id > 0) {
      Map<String,Object> thisHash=new HashMap<String,Object>();
      thisHash.put("String_Node_Str",id);
      thisHash.put("String_Node_Str",blogName);
      thisHash.put("String_Node_Str",username);
      thisHash.put("String_Node_Str",blogId);
      thisHash.put("String_Node_Str",url);
      if (extraFields != null) {
        for (int j=0; j < extraFields.length; ++j) {
          thisHash.put(extraFields[j],c.getString(6 + j));
        }
      }
      accounts.add(thisHash);
    }
    c.moveToNext();
  }
  c.close();
  Collections.sort(accounts,BlogUtils.BlogNameComparator);
  return accounts;
}