Program: 127338
Project: 127338
Buggy source:
/** 
 * DOC Comment method "updateConnectionInformation".
 * @param dbConn
 * @throws SQLException
 * @throws IllegalAccessException
 * @throws InstantiationException
 * @throws ClassNotFoundException
 */
private void updateConnectionInformation(DatabaseConnection dbConn,IMetadataConnection metaConnection) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
  java.sql.Connection sqlConn=null;
  String dbType=null;
  try {
    dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
    sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
    dbType=metaConnection.getDbType();
    if (sqlConn != null) {
      DatabaseMetaData dbMetaData=null;
      if (EDatabaseTypeName.HIVE.getXmlName().equalsIgnoreCase(dbType)) {
        dbMetaData=HiveConnectionManager.getInstance().extractDatabaseMetaData(metaConnection);
      }
 else {
        dbMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbType,false,metaConnection.getDatabase());
      }
      MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,dbMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,dbMetaData,true));
      MetadataFillFactory.getDBInstance().fillSchemas(dbConn,dbMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,dbMetaData,false));
    }
  }
  finally {
    if (dbType != null && (dbType.equals(EDatabaseTypeName.HSQLDB.getDisplayName()) || dbType.equals(EDatabaseTypeName.HSQLDB_SERVER.getDisplayName()) || dbType.equals(EDatabaseTypeName.HSQLDB_WEBSERVER.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()))) {
      ExtractMetaDataUtils.closeConnection();
    }
    Driver driver=MetadataConnectionUtils.getDerbyDriver();
    if (driver != null) {
      try {
        driver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC Comment method "updateConnectionInformation".
 * @param dbConn
 * @throws SQLException
 * @throws IllegalAccessException
 * @throws InstantiationException
 * @throws ClassNotFoundException
 */
private void updateConnectionInformation(DatabaseConnection dbConn,IMetadataConnection metaConnection) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
  java.sql.Connection sqlConn=null;
  String dbType=null;
  ExtractMetaDataUtils extractMeta=ExtractMetaDataUtils.getInstance();
  try {
    dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
    sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
    dbType=metaConnection.getDbType();
    if (sqlConn != null) {
      DatabaseMetaData dbMetaData=null;
      if (EDatabaseTypeName.HIVE.getXmlName().equalsIgnoreCase(dbType)) {
        dbMetaData=HiveConnectionManager.getInstance().extractDatabaseMetaData(metaConnection);
      }
 else {
        dbMetaData=extractMeta.getDatabaseMetaData(sqlConn,dbType,false,metaConnection.getDatabase());
      }
      MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,dbMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,dbMetaData,true));
      MetadataFillFactory.getDBInstance().fillSchemas(dbConn,dbMetaData,metaConnection,MetadataConnectionUtils.getPackageFilter(dbConn,dbMetaData,false));
    }
  }
  finally {
    if (dbType != null && (dbType.equals(EDatabaseTypeName.HSQLDB.getDisplayName()) || dbType.equals(EDatabaseTypeName.HSQLDB_SERVER.getDisplayName()) || dbType.equals(EDatabaseTypeName.HSQLDB_WEBSERVER.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()))) {
      extractMeta.closeConnection();
    }
    Driver driver=MetadataConnectionUtils.getDerbyDriver();
    if (driver != null) {
      try {
        driver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
}