Program: 129388
Project: 129388
Buggy source:
/** 
 * DOC ggu Comment method "returnMetadataColumnsFormTable".
 * @param metadataConnection
 * @param tableLabel
 * @param dontCreateClose
 * @return
 * @deprecated because still use it
 */
public synchronized List<TdColumn> returnMetadataColumnsFormTable(IMetadataConnection metadataConnection,String tableLabel,boolean... dontCreateClose){
  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());
    tableLabel=checkTableLabel(tableLabel);
    List<String> cataAndShema=getTableCatalogAndSchema((DatabaseConnection)metadataConnection.getCurrentConnection(),tableLabel);
    metadataColumns=extractColumns(dbMetaData,metadataConnection,dbType,cataAndShema.get(0),cataAndShema.get(1),tableLabel);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
 finally {
    closeConnect(metadataConnection,wapperDriver);
  }
  return metadataColumns;
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "returnMetadataColumnsFormTable".
 * @param metadataConnection
 * @param tableLabel
 * @param dontCreateClose
 * @return
 * @deprecated because still use it
 */
@Deprecated public synchronized List<TdColumn> returnMetadataColumnsFormTable(IMetadataConnection metadataConnection,String tableLabel,boolean... dontCreateClose){
  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());
    tableLabel=checkTableLabel(tableLabel);
    List<String> cataAndShema=getTableCatalogAndSchema((DatabaseConnection)metadataConnection.getCurrentConnection(),tableLabel);
    metadataColumns=extractColumns(dbMetaData,metadataConnection,dbType,cataAndShema.get(0),cataAndShema.get(1),tableLabel);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
 finally {
    closeConnection(metadataConnection,wapperDriver);
  }
  return metadataColumns;
}