Program: 102182
Project: 102182
Buggy source:
/** 
 * @see org.eclipse.jface.action.IAction#run()
 * @since 5.0
 */
@Override public void run(){
  final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
  ModelResource modelResource=null;
  if (!getSelection().isEmpty()) {
    IFile modelFile=(IFile)SelectionUtilities.getSelectedObjects(getSelection()).get(0);
    modelResource=ModelUtilities.getModelResource(modelFile);
  }
  try {
    ITeiidServer teiidServer=cachedServer;
    if (teiidServer == null) {
      if (RuntimeAssistant.ensureServerConnection(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),getString("String_Node_Str"))) {
        teiidServer=DqpPlugin.getInstance().getServerManager().getDefaultServer();
        teiidServer.connect();
      }
 else {
        return;
      }
    }
    Collection<ModelResource> relationalModels=getRelationalModelsWithConnections();
    final CreateDataSourceWizard wizard=new CreateDataSourceWizard(teiidServer,relationalModels,modelResource);
    wizard.init(iww.getWorkbench(),new StructuredSelection());
    final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
    final int rc=dialog.open();
    if (rc == Window.OK) {
      TeiidDataSourceInfo info=wizard.getTeiidDataSourceInfo();
      Properties props=info.getProperties();
      IConnectionInfoProvider provider=info.getConnectionInfoProvider();
      boolean cancelledPassword=false;
      if (null != provider.getDataSourcePasswordPropertyKey() && props.get(provider.getDataSourcePasswordPropertyKey()) == null) {
        if (provider.requiresPassword(provider.getConnectionProfile(modelResource))) {
          int result=new AbstractPasswordDialog(iww.getShell(),getString("String_Node_Str"),null){
            @SuppressWarnings("String_Node_Str") @Override protected boolean isPasswordValid(            final String password){
              pwd=password;
              return true;
            }
          }
.open();
          if (result == Window.OK) {
            props.put(provider.getDataSourcePasswordPropertyKey(),this.pwd);
          }
 else {
            cancelledPassword=true;
          }
        }
      }
      if (!cancelledPassword) {
        teiidServer.getOrCreateDataSource(info.getDisplayName(),info.getJndiName(),provider.getDataSourceType(),props);
      }
    }
  }
 catch (  Exception e) {
    if (modelResource != null) {
      MessageDialog.openError(getShell(),getString("String_Node_Str",modelResource.getItemName()),e.getMessage());
      DqpUiConstants.UTIL.log(IStatus.ERROR,e,getString("String_Node_Str",modelResource.getItemName()));
    }
 else {
      MessageDialog.openError(getShell(),getString("String_Node_Str"),e.getMessage());
      DqpUiConstants.UTIL.log(IStatus.ERROR,e,getString("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.action.IAction#run()
 * @since 5.0
 */
@Override public void run(){
  final IWorkbenchWindow iww=VdbUiPlugin.singleton.getCurrentWorkbenchWindow();
  ModelResource modelResource=null;
  if (!getSelection().isEmpty()) {
    IFile modelFile=(IFile)SelectionUtilities.getSelectedObjects(getSelection()).get(0);
    modelResource=ModelUtilities.getModelResource(modelFile);
  }
  try {
    ITeiidServer teiidServer=cachedServer;
    if (teiidServer == null) {
      if (RuntimeAssistant.ensureServerConnection(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),getString("String_Node_Str"))) {
        teiidServer=DqpPlugin.getInstance().getServerManager().getDefaultServer();
        teiidServer.connect();
      }
 else {
        return;
      }
    }
    Collection<ModelResource> relationalModels=getRelationalModelsWithConnections();
    final CreateDataSourceWizard wizard=new CreateDataSourceWizard(teiidServer,relationalModels,modelResource);
    wizard.init(iww.getWorkbench(),new StructuredSelection());
    final WizardDialog dialog=new WizardDialog(wizard.getShell(),wizard);
    final int rc=dialog.open();
    if (rc != Window.OK)     return;
    TeiidDataSourceInfo info=wizard.getTeiidDataSourceInfo();
    Properties props=info.getProperties();
    IConnectionInfoProvider provider=info.getConnectionInfoProvider();
    boolean cancelledPassword=false;
    if (null != provider.getDataSourcePasswordPropertyKey() && props.get(provider.getDataSourcePasswordPropertyKey()) == null) {
      if (info.requiresPassword()) {
        int result=new AbstractPasswordDialog(iww.getShell(),getString("String_Node_Str"),null){
          @SuppressWarnings("String_Node_Str") @Override protected boolean isPasswordValid(          final String password){
            pwd=password;
            return true;
          }
        }
.open();
        if (result == Window.OK) {
          props.put(provider.getDataSourcePasswordPropertyKey(),this.pwd);
        }
 else {
          cancelledPassword=true;
        }
      }
    }
    if (!cancelledPassword) {
      teiidServer.getOrCreateDataSource(info.getDisplayName(),info.getJndiName(),provider.getDataSourceType(),props);
    }
  }
 catch (  Exception e) {
    if (modelResource != null) {
      MessageDialog.openError(getShell(),getString("String_Node_Str",modelResource.getItemName()),e.getMessage());
      DqpUiConstants.UTIL.log(IStatus.ERROR,e,getString("String_Node_Str",modelResource.getItemName()));
    }
 else {
      MessageDialog.openError(getShell(),getString("String_Node_Str"),e.getMessage());
      DqpUiConstants.UTIL.log(IStatus.ERROR,e,getString("String_Node_Str"));
    }
  }
}