Program: 129457
Project: 129457
Buggy source:
/** 
 * DOC cantoine. Method to return a Collection of Column about a Table for a DB connection.
 * @param IMetadataConnection iMetadataConnection
 * @param String tableLabel
 * @return Collection of MetadataColumn Object of a Table
 * @deprecated
 */
public static synchronized List<TdColumn> returnMetadataColumnsFormTable(IMetadataConnection iMetadataConnection,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(iMetadataConnection.getDbType(),iMetadataConnection.getUrl(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDatabase(),iMetadataConnection.getSchema(),iMetadataConnection.getDriverClass(),iMetadataConnection.getDriverJarPath(),iMetadataConnection.getDbVersionString(),iMetadataConnection.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=iMetadataConnection.getDbType();
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(ExtractMetaDataUtils.conn,dbType,iMetadataConnection.isSqlMode(),iMetadataConnection.getDatabase());
    String name=getTableTypeByTableName(tableLabel);
    boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(iMetadataConnection.getDbType());
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName()) && !isAccess) {
      String tableName=getTableNameBySynonym(ExtractMetaDataUtils.conn,tableLabel);
      if (tableName.contains("String_Node_Str")) {
        tableName=tableName.replace("String_Node_Str","String_Node_Str");
      }
      tableLabel=tableName;
    }
    List<String> cataAndShema=getTableCatalogAndSchema((DatabaseConnection)iMetadataConnection.getCurrentConnection(),tableLabel);
    metadataColumns=extractColumns(dbMetaData,iMetadataConnection,dbType,cataAndShema.get(0),cataAndShema.get(1),tableLabel);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
 finally {
    if (wapperDriver != null && (iMetadataConnection.getDriverClass().equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_DERBYCLIENT.getDisplayName())|| dbType.equals(EDatabaseTypeName.JAVADB_JCCJDBC.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()))) {
      try {
        wapperDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return metadataColumns;
}

Fixed version (ground truth):
/** 
 * DOC cantoine. Method to return a Collection of Column about a Table for a DB connection.
 * @param IMetadataConnection iMetadataConnection
 * @param String tableLabel
 * @return Collection of MetadataColumn Object of a Table
 * @deprecated
 */
@Deprecated public static synchronized List<TdColumn> returnMetadataColumnsFormTable(IMetadataConnection iMetadataConnection,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(iMetadataConnection.getDbType(),iMetadataConnection.getUrl(),iMetadataConnection.getUsername(),iMetadataConnection.getPassword(),iMetadataConnection.getDatabase(),iMetadataConnection.getSchema(),iMetadataConnection.getDriverClass(),iMetadataConnection.getDriverJarPath(),iMetadataConnection.getDbVersionString(),iMetadataConnection.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=iMetadataConnection.getDbType();
    DatabaseMetaData dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(ExtractMetaDataUtils.conn,dbType,iMetadataConnection.isSqlMode(),iMetadataConnection.getDatabase());
    String name=getTableTypeByTableName(tableLabel);
    boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(iMetadataConnection.getDbType());
    if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName()) && !isAccess) {
      String tableName=getTableNameBySynonym(ExtractMetaDataUtils.conn,tableLabel);
      if (tableName.contains("String_Node_Str")) {
        tableName=tableName.replace("String_Node_Str","String_Node_Str");
      }
      tableLabel=tableName;
    }
    List<String> cataAndShema=getTableCatalogAndSchema((DatabaseConnection)iMetadataConnection.getCurrentConnection(),tableLabel);
    metadataColumns=extractColumns(dbMetaData,iMetadataConnection,dbType,cataAndShema.get(0),cataAndShema.get(1),tableLabel);
    if (needCreateAndClose) {
      ExtractMetaDataUtils.closeConnection();
    }
  }
 catch (  Exception e) {
    log.error(e.toString());
    throw new RuntimeException(e);
  }
 finally {
    if (wapperDriver != null && (iMetadataConnection.getDriverClass().equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_DERBYCLIENT.getDisplayName())|| dbType.equals(EDatabaseTypeName.JAVADB_JCCJDBC.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()))) {
      try {
        wapperDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return metadataColumns;
}