Program: 129391
Project: 129391
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];
  DriverShim wapperDriver=null;
  String dbType="String_Node_Str";
  try {
    if (needCreateAndClose || ExtractMetaDataUtils.conn == null || ExtractMetaDataUtils.conn.isClosed()) {
      List list=ExtractMetaDataUtils.getConnection(metadataConnection.getDbType(),metadataConnection.getUrl(),metadataConnection.getUsername(),metadataConnection.getPassword(),metadataConnection.getDatabase(),metadataConnection.getSchema(),metadataConnection.getDriverClass(),metadataConnection.getDriverJarPath(),metadataConnection.getDbVersionString(),metadataConnection.getAdditionalParams());
      if (list != null && list.size() > 0) {
        for (int i=0; i < list.size(); i++) {
          if (list.get(i) instanceof DriverShim) {
            wapperDriver=(DriverShim)list.get(i);
          }
        }
      }
    }
    dbType=metadataConnection.getDbType();
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(ExtractMetaDataUtils.conn,dbType,metadataConnection.isSqlMode(),metadataConnection.getDatabase());
    String tableLabel=tableNode.getValue();
    TableNode newNode=tableNode;
    String name=newNode.getItemType();
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName())) {
      String tableName=getTableNameBySynonyms(ExtractMetaDataUtils.conn,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 {
      if (tableLabel.contains("String_Node_Str")) {
        tableLabel=tableLabel.replace("String_Node_Str","String_Node_Str");
      }
      newNode.setValue(tableLabel);
      metadataColumns=MetadataFillFactory.getDBInstance().fillColumns(table,metadataConnection,dbMetaData,null);
    }
    ColumnSetHelper.addColumns(table,metadataColumns);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    log.error(e);
  }
 finally {
    closeConnect(metadataConnection,wapperDriver);
  }
  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];
  DriverShim wapperDriver=null;
  String dbType="String_Node_Str";
  try {
    if (needCreateAndClose || ExtractMetaDataUtils.conn == null || ExtractMetaDataUtils.conn.isClosed()) {
      List list=ExtractMetaDataUtils.getConnection(metadataConnection.getDbType(),metadataConnection.getUrl(),metadataConnection.getUsername(),metadataConnection.getPassword(),metadataConnection.getDatabase(),metadataConnection.getSchema(),metadataConnection.getDriverClass(),metadataConnection.getDriverJarPath(),metadataConnection.getDbVersionString(),metadataConnection.getAdditionalParams());
      if (list != null && list.size() > 0) {
        for (int i=0; i < list.size(); i++) {
          if (list.get(i) instanceof DriverShim) {
            wapperDriver=(DriverShim)list.get(i);
          }
        }
      }
    }
    dbType=metadataConnection.getDbType();
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(ExtractMetaDataUtils.conn,dbType,metadataConnection.isSqlMode(),metadataConnection.getDatabase());
    String tableLabel=tableNode.getValue();
    TableNode newNode=tableNode;
    String name=newNode.getItemType();
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName())) {
      String tableName=getTableNameBySynonyms(ExtractMetaDataUtils.conn,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 {
      if (tableLabel.contains("String_Node_Str")) {
        tableLabel=tableLabel.replace("String_Node_Str","String_Node_Str");
      }
      newNode.setValue(tableLabel);
      metadataColumns=MetadataFillFactory.getDBInstance().fillColumns(table,metadataConnection,dbMetaData,null);
    }
    ColumnSetHelper.addColumns(table,metadataColumns);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    log.error(e);
  }
 finally {
    closeConnection(metadataConnection,wapperDriver);
  }
  return metadataColumns;
}