Program: 44334
Project: 44334
Buggy source:
public ArrayList<T> simpleSelectList(Connection con,T bean,BeanDescriptor descriptor) throws SQLException {
  ArrayList<T> beanList=new ArrayList<T>();
  Map<String,String> columnPropertyMap=Utils.getColumnPropertyMap(descriptor.getPropertyMap());
  PreparedStatement ps=buildSelectStatement(bean,descriptor,con);
  ResultSet rs=ps.executeQuery();
  HashMap<String,Object> props=new HashMap<String,Object>();
  ResultSetMetaData metaData=rs.getMetaData();
  int columnCount=metaData.getColumnCount();
  while (rs.next()) {
    for (int i=1; i <= columnCount; i++) {
      if (columnPropertyMap.containsKey(metaData.getColumnName((i)))) {
        if (metaData.getColumnType(i) == Types.BLOB) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          Blob blob=rs.getBlob(metaData.getColumnName(i));
          if (blob != null) {
            if (log.isDebugEnabled()) {
              log.debug("String_Node_Str" + i + "String_Node_Str");
            }
            ByteArrayOutputStream baos=new ByteArrayOutputStream(1024);
            BufferedInputStream bis=new BufferedInputStream(blob.getBinaryStream());
            byte[] buffer=new byte[1024];
            int curByte;
            try {
              while ((curByte=bis.read(buffer,0,buffer.length)) != -1) {
                baos.write(buffer,0,curByte);
              }
            }
 catch (            IOException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException("String_Node_Str",e);
            }
            props.put(Utils.getCamelCaseColumnName(metaData.getColumnName(i)),baos.toByteArray());
          }
        }
 else         if (metaData.getColumnType(i) == Types.CLOB) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getString(i));
        }
 else         if (metaData.getColumnType(i) == Types.DATE) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTimestamp(i));
        }
 else         if (metaData.getColumnType(i) == Types.TIME) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTime(i));
        }
 else         if (metaData.getColumnType(i) == Types.TIMESTAMP) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTimestamp(i));
        }
 else {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getString(i));
        }
      }
    }
    T newBean;
    try {
      newBean=(T)bean.getClass().newInstance();
    }
 catch (    Exception e) {
      log.error("String_Node_Str",e);
      throw new RuntimeException("String_Node_Str",e);
    }
    ReflectionUtils.populateBean(newBean,props);
    beanList.add(newBean);
  }
  ps.close();
  return beanList;
}

Fixed version (ground truth):
public ArrayList<T> simpleSelectList(Connection con,T bean,BeanDescriptor descriptor) throws SQLException {
  ArrayList<T> beanList=new ArrayList<T>();
  Map<String,String> columnPropertyMap=Utils.getColumnPropertyMap(descriptor.getPropertyMap());
  PreparedStatement ps=buildSelectStatement(bean,descriptor,con);
  ResultSet rs=ps.executeQuery();
  ResultSetMetaData metaData=rs.getMetaData();
  int columnCount=metaData.getColumnCount();
  while (rs.next()) {
    HashMap<String,Object> props=new HashMap<String,Object>();
    for (int i=1; i <= columnCount; i++) {
      if (columnPropertyMap.containsKey(metaData.getColumnName((i)))) {
        if (metaData.getColumnType(i) == Types.BLOB) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          Blob blob=rs.getBlob(metaData.getColumnName(i));
          if (blob != null) {
            if (log.isDebugEnabled()) {
              log.debug("String_Node_Str" + i + "String_Node_Str");
            }
            ByteArrayOutputStream baos=new ByteArrayOutputStream(1024);
            BufferedInputStream bis=new BufferedInputStream(blob.getBinaryStream());
            byte[] buffer=new byte[1024];
            int curByte;
            try {
              while ((curByte=bis.read(buffer,0,buffer.length)) != -1) {
                baos.write(buffer,0,curByte);
              }
            }
 catch (            IOException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException("String_Node_Str",e);
            }
            props.put(Utils.getCamelCaseColumnName(metaData.getColumnName(i)),baos.toByteArray());
          }
        }
 else         if (metaData.getColumnType(i) == Types.CLOB) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getString(i));
        }
 else         if (metaData.getColumnType(i) == Types.DATE) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTimestamp(i));
        }
 else         if (metaData.getColumnType(i) == Types.TIME) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTime(i));
        }
 else         if (metaData.getColumnType(i) == Types.TIMESTAMP) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getTimestamp(i));
        }
 else {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + i + "String_Node_Str");
          }
          props.put(columnPropertyMap.get(metaData.getColumnName(i)),rs.getString(i));
        }
      }
    }
    T newBean;
    try {
      newBean=(T)bean.getClass().newInstance();
    }
 catch (    Exception e) {
      log.error("String_Node_Str",e);
      throw new RuntimeException("String_Node_Str",e);
    }
    ReflectionUtils.populateBean(newBean,props);
    beanList.add(newBean);
  }
  ps.close();
  return beanList;
}