Program: 127339
Project: 127339
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()) {
    DatabaseForm form=(DatabaseForm)databaseWizardPage.getControl();
    List<HashMap<String,Object>> properties=form.getProperties();
    try {
      connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES,getHadoopPropertiesString(properties));
    }
 catch (    JSONException e1) {
      String detailError=e1.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    EDatabaseTypeName dbType=EDatabaseTypeName.getTypeFromDbType(connection.getDatabaseType());
    if (dbType != EDatabaseTypeName.GENERAL_JDBC) {
      String driverClass=ExtractMetaDataUtils.getDriverClassByDbType(connection.getDatabaseType());
      if (EDatabaseTypeName.VERTICA.equals(dbType) && (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(connection.getDbVersionString()) || EDatabaseVersion4Drivers.VERTICA_5_1.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);
    }
    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.removeAliasInSQLExplorer(node);
        tdqRepService.notifySQLExplorer(connectionItem);
        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()) {
    DatabaseForm form=(DatabaseForm)databaseWizardPage.getControl();
    List<HashMap<String,Object>> properties=form.getProperties();
    try {
      connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES,getHadoopPropertiesString(properties));
    }
 catch (    JSONException e1) {
      String detailError=e1.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    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()))) {
        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);
    }
    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.removeAliasInSQLExplorer(node);
        tdqRepService.notifySQLExplorer(connectionItem);
        tdqRepService.refreshConnectionEditor(connectionItem);
      }
      if (CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
        tdqRepService.refresh(node.getParent());
      }
    }
    refreshHadoopCluster();
    return true;
  }
 else {
    return false;
  }
}