Program: 139846
Project: 139846
Buggy source:
/** 
 * Method "getColumns". MOD xqliu 2009-04-27 bug 6507
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  if (debug)   incrementCount(catalogName,schemaPattern,tablePattern);
  if (columnPattern == null) {
    addMatchingColumns(catalogName,schemaPattern,tablePattern,columnPattern,tableColumns);
  }
 else {
    String[] patterns=cleanPatterns(columnPattern.split("String_Node_Str"));
    for (    String pattern : patterns) {
      addMatchingColumns(catalogName,schemaPattern,tablePattern,pattern,tableColumns);
    }
  }
  return tableColumns;
}

Fixed version (ground truth):
/** 
 * Method "getColumns".
 * @param catalogName a catalog name; must match the catalog name as it is stored in the database; "" retrievesthose without a catalog; null means that the catalog name should not be used to narrow the search
 * @param schemaPattern a schema name pattern; must match the schema name as it is stored in the database; ""retrieves those without a schema; null means that the schema name should not be used to narrow the search
 * @param tablePattern a table name pattern; must match the table name as it is stored in the database
 * @param columnPattern a column name pattern; must match the column name as it is stored in the database
 * @throws SQLException
 * @see DatabaseMetaData#getColumns(String,String,String,String)
 */
public List<TdColumn> getColumns(String catalogName,String schemaPattern,String tablePattern,String columnPattern) throws SQLException {
  List<TdColumn> tableColumns=new ArrayList<TdColumn>();
  ResultSet columns=getConnectionMetadata(connection).getColumns(catalogName,schemaPattern,tablePattern,columnPattern);
  while (columns.next()) {
    Object defaultvalue=columns.getObject(GetColumn.COLUMN_DEF.name());
    String defaultStr=(defaultvalue != null) ? String.valueOf(defaultvalue) : null;
    Expression defExpression=BooleanExpressionHelper.createExpression(GetColumn.COLUMN_DEF.name(),defaultStr);
    String colName=columns.getString(GetColumn.COLUMN_NAME.name());
    TdColumn column=ColumnHelper.createTdColumn(colName);
    column.setLength(columns.getInt(GetColumn.COLUMN_SIZE.name()));
    column.setIsNullable(NullableType.get(columns.getInt(GetColumn.NULLABLE.name())));
    column.setJavaType(columns.getInt(GetColumn.DATA_TYPE.name()));
    String colComment=getComment(colName,columns);
    TaggedValueHelper.setComment(colComment,column);
    TdSqlDataType sqlDataType=DatabaseContentRetriever.createDataType(columns);
    column.setSqlDataType(sqlDataType);
    column.setInitialValue(defExpression);
    tableColumns.add(column);
  }
  columns.close();
  return tableColumns;
}