Program: 7508
Project: 7508
Buggy source:
/** 
 * Converts a query result set to a data object.
 * @param rs             the result set to convert
 * @param mapMetadata    the meta-data mapping flag
 * @param mapColumnName  the column name to property mapping flag
 * @return the data object with all the result data
 * @throws AdapterException if the result data couldn't be read
 */
private Data createResults(ResultSet rs,boolean mapMetadata,boolean mapColumnName) throws AdapterException {
  Data res=new Data();
  Data cols;
  Data rows=new Data(10);
  Data obj;
  ResultSetMetaData meta;
  int colCount;
  String value;
  try {
    meta=rs.getMetaData();
    colCount=meta.getColumnCount();
    cols=new Data(colCount);
    for (int i=0; i < colCount; i++) {
      obj=new Data();
      obj.set("String_Node_Str",meta.getColumnName(i + 1).toLowerCase());
      obj.set("String_Node_Str",meta.getCatalogName(i + 1));
      obj.set("String_Node_Str",meta.getColumnTypeName(i + 1));
      obj.setInt("String_Node_Str",meta.getColumnType(i + 1));
      obj.set("String_Node_Str",meta.getSchemaName(i + 1));
      obj.set("String_Node_Str",meta.getTableName(i + 1));
      obj.set("String_Node_Str",meta.getColumnName(i + 1));
      cols.add(obj);
    }
    while (rs.next()) {
      obj=mapColumnName ? new Data() : new Data(colCount);
      for (int i=0; i < colCount; i++) {
switch (meta.getColumnType(i + 1)) {
case Types.DATE:
case Types.TIMESTAMP:
          value=DateUtil.formatIsoDateTime(rs.getTimestamp(i + 1));
        break;
default :
      value=rs.getString(i + 1);
  }
  if (mapColumnName) {
    obj.set(meta.getColumnName(i + 1).toLowerCase(),value);
  }
 else {
    obj.set(i,value);
  }
}
rows.add(obj);
}
res.set("String_Node_Str",cols);
res.set("String_Node_Str",rows);
}
 catch (SQLException e) {
throw new AdapterException("String_Node_Str" + e.getMessage());
}
return mapMetadata ? res : rows;
}

Fixed version (ground truth):
/** 
 * Converts a query result set to a data object.
 * @param rs             the result set to convert
 * @param mapMetadata    the meta-data mapping flag
 * @param mapColumnName  the column name to property mapping flag
 * @return the data object with all the result data
 * @throws AdapterException if the result data couldn't be read
 */
private Data createResults(ResultSet rs,boolean mapMetadata,boolean mapColumnName) throws AdapterException {
  Data res=new Data();
  Data cols;
  Data rows=new Data(10);
  Data obj;
  ResultSetMetaData meta;
  int colCount;
  String value;
  try {
    meta=rs.getMetaData();
    colCount=meta.getColumnCount();
    cols=new Data(colCount);
    for (int i=0; i < colCount; i++) {
      obj=new Data();
      obj.set("String_Node_Str",meta.getColumnName(i + 1).toLowerCase());
      obj.set("String_Node_Str",meta.getCatalogName(i + 1));
      obj.set("String_Node_Str",meta.getColumnTypeName(i + 1));
      obj.setInt("String_Node_Str",meta.getColumnType(i + 1));
      obj.set("String_Node_Str",meta.getSchemaName(i + 1));
      obj.set("String_Node_Str",meta.getTableName(i + 1));
      obj.set("String_Node_Str",meta.getColumnName(i + 1));
      cols.add(obj);
    }
    while (rs.next()) {
      obj=mapColumnName ? new Data() : new Data(colCount);
      for (int i=0; i < colCount; i++) {
switch (meta.getColumnType(i + 1)) {
case Types.DATE:
case Types.TIMESTAMP:
          try {
            value=DateUtil.formatIsoDateTime(rs.getTimestamp(i + 1));
          }
 catch (          SQLException e) {
            value=null;
          }
        break;
default :
      value=rs.getString(i + 1);
  }
  if (mapColumnName) {
    obj.set(meta.getColumnName(i + 1).toLowerCase(),value);
  }
 else {
    obj.set(i,value);
  }
}
rows.add(obj);
}
res.set("String_Node_Str",cols);
res.set("String_Node_Str",rows);
}
 catch (SQLException e) {
throw new AdapterException("String_Node_Str" + e.getMessage());
}
return mapMetadata ? res : rows;
}