Program: 126452
Project: 126452
Buggy source:
/** 
 * DOC zhao Comment method "handleCreation".
 * @param dbConn
 * @param metadataConnection
 * @param tdqRepService
 * @throws PersistenceException
 */
private void handleCreation(DatabaseConnection dbConn,IMetadataConnection metadataConnection,ITDQRepositoryService tdqRepService) throws PersistenceException {
  connectionProperty.setId(propertyId);
  if (connectionItem.getConnection() instanceof DatabaseConnection) {
    DatabaseConnection c=(DatabaseConnection)connectionItem.getConnection();
    final boolean equals=c.getProductId().equals(EDatabaseTypeName.ORACLEFORSID.getProduct());
    if (equals && !c.isContextMode()) {
      if (c.getUiSchema() == null) {
        c.setUiSchema("String_Node_Str");
      }
 else {
        c.setUiSchema(c.getUiSchema().toUpperCase());
      }
    }
  }
  EDatabaseTypeName type=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDbType());
  String displayName=connectionProperty.getDisplayName();
  this.connection.setName(displayName);
  this.connection.setLabel(displayName);
  if (tdqRepService != null) {
    tdqRepService.checkUsernameBeforeSaveConnection(connectionItem);
  }
  repFactory.create(connectionItem,propertiesWizardPage.getDestinationPath());
  ConnectionHelper.setIsConnNeedReload(connection,Boolean.FALSE);
  ConnectionHelper.setPackageFilter(connection,"String_Node_Str");
  String hiveMode=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(metadataConnection.getDbType()) && HiveConnVersionInfo.MODE_EMBEDDED.getKey().equals(hiveMode)) {
    JavaSqlFactory.doHivePreSetup((DatabaseConnection)metadataConnection.getCurrentConnection());
  }
  MetadataConnectionUtils.fillConnectionInformation(connectionItem,metadataConnection);
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(connection);
  List<Schema> schemas=ConnectionHelper.getSchema(connection);
  if (catalogs.isEmpty() && schemas.isEmpty()) {
    IDBMetadataProvider extractor=ExtractMetaDataFromDataBase.getProviderByDbType(metadataConnection.getDbType());
    if (extractor != null && type.isUseProvider()) {
      extractor.fillConnection(connection);
      repFactory.save(connectionItem);
    }
  }
  if (tdqRepService != null) {
    tdqRepService.publishSoftwareSystemUpdateEvent(dbConn);
  }
}

Fixed version (ground truth):
/** 
 * DOC zhao Comment method "handleCreation".
 * @param dbConn
 * @param metadataConnection
 * @param tdqRepService
 * @throws PersistenceException
 */
private void handleCreation(DatabaseConnection dbConn,IMetadataConnection metadataConnection,ITDQRepositoryService tdqRepService) throws PersistenceException {
  connectionProperty.setId(propertyId);
  if (connectionItem.getConnection() instanceof DatabaseConnection) {
    DatabaseConnection c=(DatabaseConnection)connectionItem.getConnection();
    final boolean equals=c.getProductId().equals(EDatabaseTypeName.ORACLEFORSID.getProduct());
    if (equals && !c.isContextMode()) {
      if (c.getUiSchema() == null) {
        c.setUiSchema("String_Node_Str");
      }
 else {
        c.setUiSchema(c.getUiSchema().toUpperCase());
      }
    }
  }
  EDatabaseTypeName type=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDbType());
  String displayName=connectionProperty.getDisplayName();
  this.connection.setName(displayName);
  this.connection.setLabel(displayName);
  if (tdqRepService != null) {
    tdqRepService.checkUsernameBeforeSaveConnection(connectionItem);
  }
  repFactory.create(connectionItem,propertiesWizardPage.getDestinationPath());
  ConnectionHelper.setIsConnNeedReload(connection,Boolean.FALSE);
  ConnectionHelper.setPackageFilter(connection,"String_Node_Str");
  String hiveMode=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(metadataConnection.getDbType()) && HiveConnVersionInfo.MODE_EMBEDDED.getKey().equals(hiveMode)) {
    JavaSqlFactory.doHivePreSetup((DatabaseConnection)metadataConnection.getCurrentConnection());
  }
  if (false) {
    MetadataConnectionUtils.fillConnectionInformation(connectionItem,metadataConnection);
  }
  List<Catalog> catalogs=ConnectionHelper.getCatalogs(connection);
  List<Schema> schemas=ConnectionHelper.getSchema(connection);
  if (catalogs.isEmpty() && schemas.isEmpty()) {
    IDBMetadataProvider extractor=ExtractMetaDataFromDataBase.getProviderByDbType(metadataConnection.getDbType());
    if (extractor != null && type.isUseProvider()) {
      extractor.fillConnection(connection);
      repFactory.save(connectionItem);
    }
  }
  if (tdqRepService != null) {
    tdqRepService.publishSoftwareSystemUpdateEvent(dbConn);
  }
}