Program: 125520
Project: 125520
Buggy source:
/** 
 * DOC ggu Comment method "returnColumns". work for @see ExtractMetaDataFromDataBase.returnColumns(...)
 * @param metadataConnection
 * @param tableNode
 * @param dontCreateClose
 * @return
 */
public List<TdColumn> returnColumns(IMetadataConnection metadataConnection,TableNode tableNode,boolean... dontCreateClose){
  if (metadataConnection == null || tableNode == null || tableNode.getType() != TableNode.TABLE) {
    return Collections.emptyList();
  }
  NamedColumnSet table=tableNode.getTable();
  if (table == null) {
    table=tableNode.getView();
  }
  if (table == null) {
    return Collections.emptyList();
  }
  List<TdColumn> metadataColumns=new ArrayList<TdColumn>();
  boolean needCreateAndClose=dontCreateClose.length == 0 || !dontCreateClose[0];
  ExtractMetaDataUtils extractMeta=ExtractMetaDataUtils.getInstance();
  try {
    DatabaseMetaData dbMetaData=createDatabaseMetaData(metadataConnection,needCreateAndClose);
    TableNode newNode=tableNode;
    String name=newNode.getItemType();
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName())) {
      String tableName=getTableNameBySynonyms(extractMeta.getConn(),newNode.getValue());
      if (tableName != null && tableName.contains("String_Node_Str")) {
        tableName=tableName.replace("String_Node_Str","String_Node_Str");
      }
      fillSynonyms(metadataConnection,metadataColumns,table,tableName,dbMetaData);
    }
 else {
      EDatabaseTypeName currentEDatabaseType=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDbType());
      metadataColumns=MetadataFillFactory.getDBInstance(currentEDatabaseType).fillColumns(table,metadataConnection,dbMetaData,null);
    }
    ColumnSetHelper.addColumns(table,metadataColumns);
    if (needCreateAndClose) {
      extractMeta.closeConnection();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    log.error(e);
  }
 finally {
    if (extractMeta.getConn() != null) {
      ConnectionUtils.closeConnection(extractMeta.getConn());
    }
  }
  return metadataColumns;
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "returnColumns". work for @see ExtractMetaDataFromDataBase.returnColumns(...)
 * @param metadataConnection
 * @param tableNode
 * @param dontCreateClose
 * @return
 */
public List<TdColumn> returnColumns(IMetadataConnection metadataConnection,TableNode tableNode,boolean... dontCreateClose){
  if (metadataConnection == null || tableNode == null || tableNode.getType() != TableNode.TABLE) {
    return Collections.emptyList();
  }
  NamedColumnSet table=tableNode.getTable();
  if (table == null) {
    table=tableNode.getView();
  }
  if (table == null) {
    return Collections.emptyList();
  }
  List<TdColumn> metadataColumns=new ArrayList<TdColumn>();
  boolean needCreateAndClose=dontCreateClose.length == 0 || !dontCreateClose[0];
  ExtractMetaDataUtils extractMeta=ExtractMetaDataUtils.getInstance();
  try {
    DatabaseMetaData dbMetaData=createDatabaseMetaData(metadataConnection,needCreateAndClose);
    TableNode newNode=tableNode;
    String name=newNode.getItemType();
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName())) {
      String tableName=getTableNameBySynonyms(extractMeta.getConn(),newNode.getValue());
      if (tableName != null && tableName.contains("String_Node_Str")) {
        tableName=tableName.replace("String_Node_Str","String_Node_Str");
      }
      fillSynonyms(metadataConnection,metadataColumns,table,tableName,dbMetaData);
    }
 else {
      EDatabaseTypeName currentEDatabaseType=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDbType());
      metadataColumns=MetadataFillFactory.getDBInstance(currentEDatabaseType).fillColumns(table,metadataConnection,dbMetaData,null);
    }
    ColumnSetHelper.addColumns(table,metadataColumns);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    log.error(e);
  }
 finally {
    if (needCreateAndClose && extractMeta.getConn() != null) {
      extractMeta.closeConnection();
    }
  }
  return metadataColumns;
}