Program: 126345
Project: 126345
Buggy source:
/** 
 * This method is called when 'Finish' button is pressed in the wizard. Save metadata close Lock Strategy and close wizard.
 */
@Override public boolean performFinish(){
  if (databaseWizardPage.isPageComplete()) {
    EDatabaseTypeName dbType=EDatabaseTypeName.getTypeFromDbType(connection.getDatabaseType());
    if (dbType != EDatabaseTypeName.GENERAL_JDBC) {
      String driverClass=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(connection.getDatabaseType());
      if (EDatabaseTypeName.VERTICA.equals(dbType) && (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(connection.getDbVersionString()) || EDatabaseVersion4Drivers.VERTICA_5_1.getVersionValue().equals(connection.getDbVersionString()) || EDatabaseVersion4Drivers.VERTICA_6_1_X.getVersionValue().equals(connection.getDbVersionString())|| EDatabaseVersion4Drivers.VERTICA_7.getVersionValue().equals(connection.getDbVersionString()))) {
        driverClass=EDatabase4DriverClassName.VERTICA2.getDriverClass();
      }
      ((DatabaseConnection)connectionItem.getConnection()).setDriverClass(driverClass);
    }
    String contextName=null;
    if (databaseWizardPage.getSelectedContextType() != null) {
      contextName=databaseWizardPage.getSelectedContextType().getName();
    }
    IMetadataConnection metadataConnection=null;
    if (contextName == null) {
      metadataConnection=ConvertionHelper.convert(connection,true);
    }
 else {
      metadataConnection=ConvertionHelper.convert(connection,false,contextName);
    }
    ITDQRepositoryService tdqRepService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      tdqRepService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
    }
    if (!connection.isContextMode()) {
      handleUppercase(connection,metadataConnection);
    }
    try {
      if (creation) {
        handleCreation(connection,metadataConnection,tdqRepService);
      }
 else {
        Boolean isSuccess=handleUpdate(metadataConnection,tdqRepService);
        if (!isSuccess) {
          return false;
        }
      }
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    List<IRepositoryViewObject> list=new ArrayList<IRepositoryViewObject>();
    list.add(repositoryObject);
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
      IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
      service.notifySQLBuilder(list);
    }
    if (tdqRepService != null) {
      if (creation) {
        tdqRepService.notifySQLExplorer(connectionItem);
        tdqRepService.openConnectionEditor(connectionItem);
      }
 else {
        tdqRepService.updateAliasInSQLExplorer(connectionItem,originaleObjectLabel);
        tdqRepService.refreshConnectionEditor(connectionItem);
      }
      if (CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
        tdqRepService.refresh(node.getParent());
      }
    }
    refreshHadoopCluster();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method is called when 'Finish' button is pressed in the wizard. Save metadata close Lock Strategy and close wizard.
 */
@Override public boolean performFinish(){
  if (databaseWizardPage.isPageComplete()) {
    EDatabaseTypeName dbType=EDatabaseTypeName.getTypeFromDbType(connection.getDatabaseType());
    if (dbType != EDatabaseTypeName.GENERAL_JDBC) {
      String driverClass=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(connection.getDatabaseType());
      DatabaseConnection dbConnection=(DatabaseConnection)connectionItem.getConnection();
      if (EDatabaseTypeName.VERTICA.equals(dbType) && (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(connection.getDbVersionString()) || EDatabaseVersion4Drivers.VERTICA_5_1.getVersionValue().equals(connection.getDbVersionString()) || EDatabaseVersion4Drivers.VERTICA_6_1_X.getVersionValue().equals(connection.getDbVersionString())|| EDatabaseVersion4Drivers.VERTICA_7.getVersionValue().equals(connection.getDbVersionString()))) {
        driverClass=EDatabase4DriverClassName.VERTICA2.getDriverClass();
      }
      if (EDatabaseTypeName.IMPALA.equals(dbType)) {
        String distributionName=dbConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
        EImpalaDistributions distribution=EImpalaDistributions.getDistributionByName(distributionName,false);
        if (null != distribution && EImpalaDistributions.CUSTOM != distribution) {
          dbConnection.setDbVersionString(dbConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION));
        }
      }
      dbConnection.setDriverClass(driverClass);
    }
    String contextName=null;
    if (databaseWizardPage.getSelectedContextType() != null) {
      contextName=databaseWizardPage.getSelectedContextType().getName();
    }
    IMetadataConnection metadataConnection=null;
    if (contextName == null) {
      metadataConnection=ConvertionHelper.convert(connection,true);
    }
 else {
      metadataConnection=ConvertionHelper.convert(connection,false,contextName);
    }
    ITDQRepositoryService tdqRepService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      tdqRepService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
    }
    if (!connection.isContextMode()) {
      handleUppercase(connection,metadataConnection);
    }
    try {
      if (creation) {
        handleCreation(connection,metadataConnection,tdqRepService);
      }
 else {
        Boolean isSuccess=handleUpdate(metadataConnection,tdqRepService);
        if (!isSuccess) {
          return false;
        }
      }
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    List<IRepositoryViewObject> list=new ArrayList<IRepositoryViewObject>();
    list.add(repositoryObject);
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
      IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
      service.notifySQLBuilder(list);
    }
    if (tdqRepService != null) {
      if (creation) {
        tdqRepService.notifySQLExplorer(connectionItem);
        tdqRepService.openConnectionEditor(connectionItem);
      }
 else {
        tdqRepService.updateAliasInSQLExplorer(connectionItem,originaleObjectLabel);
        tdqRepService.refreshConnectionEditor(connectionItem);
      }
      if (CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
        tdqRepService.refresh(node.getParent());
      }
    }
    refreshHadoopCluster();
    return true;
  }
 else {
    return false;
  }
}